BEGIN statement
404
BEGIN statement
Use this statement to group SQL statements together.
[
statement-label
: ]
… BEGIN [ [ NOT ] ATOMIC ]
…[
local-declaration
; … ]
…
statement-list
…[ EXCEPTION [
exception-case
… ] ]
… END [
statement-label
]
local-declaration
:
variable-declaration
|
cursor-declaration
|
exception-declaration
|
temporary-table-declaration
variable-declaration
:
DECLARE
variable-name
data-type
exception-declaration
:
DECLARE
exception-name
EXCEPTION
FOR SQLSTATE [ VALUE ]
string
exception-case
:
WHEN
exception-name
[, … ] THEN
statement-list
| WHEN OTHERS THEN
statement-list
None.
None.
"DECLARE CURSOR statement" on page 488
"DECLARE LOCAL TEMPORARY TABLE statement" on page 495
"LEAVE statement" on page 558
"SIGNAL statement" on page 619
"RESIGNAL statement" on page 590
"Using Procedures, Triggers, and Batches" on page 435 of the book ASA
User’s Guide
The body of a procedure or trigger is a compound statement. Compound
statements can also be used in control statements within a procedure or
trigger.
A compound statement allows one or more SQL statements to be grouped
together and treated as a unit. A compound statement starts with the keyword
BEGIN and ends with the keyword END.
Function
Syntax
Permissions
Side effects
See also
Description