Procedure Structure
From SQL PL Guide for DB2
DB2 Stored Procedure structure
A stored procedure in DB2 has the following structure:
CREATE PROCEDURE <procname> [ ( {optional parameters} ) ]
[{optional procedure attributes}]
BEGIN [atomic]
... statements ...
END
The following optional procedure attributes are supported:
- SPECIFIC <unique_name>
- DYNAMIC RESULT SETS <number>
- CONTAINS SQL or READS SQL DATA or MODIFIES SQL DATA
- [NOT] DETERMINISTIC
- CALLED ON NULL INPUT
- LANGUAGE SQL
A procedure can be defined as ATOMIC or NON-ATOMIC procedure.
The declaration of variables, the statements, and procedure logic is placed in the procedure body.
Example:
- ...coming soon...