An SQL stored procedure contains some or all of the following elements.
This element… |
Includes… |
SQL control statements |
nested or non-nested compound statements. |
Control declarations |
Cursors can be either updatable or read only type. Cursors can also be result set cursors for returning the result of a SELECT statement executed in the stored procedure to the caller or client applications |
SQL transaction statements |
DDL, DCL, DML, and SELECT statements, including dynamic SQL statements, with a few exceptions. |
LOCKING modifiers |
with all supported SQL statements except CALL. |
Comments |
bracketed and simple comments. Note: Nested bracketed comments are not allowed. |
For more information, see “SQL Stored Procedures as SQL Applications” on page 98.