Previous Topic: When to Use a ProcedureNext Topic: Invoking a Procedure


Defining a Procedure

How to define and deploy SQL-invoked procedures depends on the language of the procedure.

In the following example, the procedure GET_BONUS is named and associated with schema EMP. The name of the program to be called to service a CALL request of the procedure, CALCSAL, is specified in the EXTERNAL NAME parameter. The PROTOCOL IDMS specifies that the procedure is defined and called using the IDMS protocol. The parameters that pass to and from the procedure are listed. Each parameter definition consists of a name and a data type.

    CREATE PROCEDURE EMP.GET_BONUS
   ( EMP_ID            UNSIGNED NUMERIC (4),
     START_DATE        DATE,
     SALARY              UNSIGNED NUMERIC (9))
   EXTERNAL NAME CALCSAL
   PROTOCOL IDMS;
More Information