Compound Statement
You are looking at an older version of the documentation. The latest version is found here.
A compound statement or block logically groups a series of statements. Temporary tables and variables created in a compound statement are local only to that block and are destroyed when exiting the block.
Usage
[label :] BEGIN [[NOT] ATOMIC]
statement*
[EXCEPTION ex
statement*
]
END
IF
, LOOP
, WHILE
, etc. a single statement is also accepted by the parser. Even though the block BEGIN/END
is not expected, the statement will execute as if wrapped in a BEGIN/END
pair.
Syntax
- If
NOT ATOMIC
or noATOMIC
clause is specified, the block will be executed non-atomically; - If
ATOMIC
is specified the block must execute atomically. If a transaction is already associated with the thread, no additional action will be taken - savepoints and/or sub-transactions are not currently used; - Otherwise, a transaction will be associated with the execution of the block;
- The label must not be the same as any other label used in statements containing this one.