The NZPLSQL language is a block-structured language.
[<<label>>]
[DECLARE
declarations]
BEGIN
statements
[EXCEPTION WHEN OTHERS THEN
handler statements]
END;
The statements section of a block can contain zero, one, or more sub-blocks. A sub-block is used for logical grouping or to localize variables to a small group of statements.
All of the keywords and identifiers are not case-sensitive and can be used in mixed uppercase and lowercase mode. Identifiers are automatically converted to uppercase, as they are in general SQL statements, unless they are enclosed in quotation marks to keep them case-sensitive.
The variables declared in the declarations section that precedes a block are initialized to their default values every time that the block is entered, not just once per procedure call.