An SQL procedure is a stored procedure in which the procedural logic is contained in a CREATE PROCEDURE statement. The part of the CREATE PROCEDURE statement that contains the code is called the procedure body.
To create an SQL procedure, simply issue the CREATE PROCEDURE statement like any other DDL statement. You can also use the IBM DB2 Stored Procedure Builder to help you define the stored procedure to DB2, specify the source statements for the SQL procedure, and prepare the procedure for execution. For more information on the IBM DB2 Stored Procedure Builder, see IBM DB2 Stored Procedure Builder.
This chapter discusses how to write a CREATE PROCEDURE statement that includes a procedure body. For more information on the syntax of the CREATE PROCEDURE statement and the procedure body, refer to the SQL Reference. For more information on using the IBM DB2 Stored Procedure Builder to create SQL procedures, see IBM DB2 Stored Procedure Builder.