February 23, 2012, Thursday, 53


Create Procedure

From SQL PL Guide for DB2

Jump to: navigation, search

Create Procedure (DB2 Stored Procedure structure)

A stored procedure in DB2 has the following structure:

 CREATE PROCEDURE [OR REPLACE] <procname> [ ( {optional parameters} ) ]
 [{optional procedure attributes}]
 BEGIN [atomic]
   ... statements ...
 END


The following optional procedure attributes are supported:


A procedure can be defined as ATOMIC or NON-ATOMIC procedure.


The OR REPLACE option is available with DB2 9.7.

The declaration of variables, the statements, and procedure logic is placed in the procedure body.


Example:

...coming soon...




Link to the DB2 Information Center: DB2 9 DB2 9.5 DB2 9.7