SQL Language Guide : 7. Database Procedures, Sessions, and Events : How Database Procedures Are Created, Invoked, and Executed : Contents of Database Procedures
 
Share this page                  
Contents of Database Procedures
A database procedure can include the following entities:
Local variable declarations
Data manipulation statements such as SELECT or INSERT
Control flow statements such as IF, FOR, and WHILE
Status statements, such as MESSAGE, RETURN, RETURN ROW, and RAISE ERROR
The DBMS Server resolves all references to database objects in a database procedure at the time the procedure is created. For this reason, all referenced objects must exist at the time the procedure is created. If, at the time it is created, a procedure refers to a DBA-owned table, the procedure always uses that table, even if a user that owns a table with the same name executes the procedure.
Note:  Database local variables must be preceded by a colon when used in data manipulation statements.