BEGIN-END statement enclosing a set of declarations and statements.
You can specify local variable declarations, cursor declarations, condition handler declarations and SQL and control statements within a compound statement.
Nesting of compound statements is allowed.
You can specify these options for a compound statement.
- label_name
- Label for a BEGIN-END compound statement in the procedure, or for an iteration statement (WHILE, LOOP, FOR and REPEAT).
- BEGIN
- Keyword introducing a compound statement.
- statement_list
- Any of the following:
- SQL DML, DDL, or DCL statements supported by SQL procedures, including dynamic SQL statements.
You can also use the CALL statement invoking the procedure_name being created.
- control statements, including the BEGIN-END compound statement.
- SQL DML, DDL, or DCL statements supported by SQL procedures, including dynamic SQL statements.
- END
- Terminating keyword for a BEGIN-END compound statement.