IBM PureData System for Analytics, Version 7.1

NZPLSQL structure

The NZPLSQL language is a block-structured language.

A block is defined as follows:
[<<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.

Note: Be careful not to confuse the use of BEGIN/END for grouping statements in NZPLSQL with the BEGIN/END SQL database commands for transaction control. The NZPLSQL BEGIN/END keywords are used only for grouping; they do not start or end a transaction. Procedures are always executed within a transaction established by an outer query; they cannot start or commit transactions, since IBM® Netezza® SQL does not have nested transactions.


Feedback | Copyright IBM Corporation 2014 | Last updated: 2014-02-28