Was this helpful?
DECLARE
The DECLARE statement can be used in a database procedure definition to declare a list of local variables for use in the procedure. If used, place it before the BEGIN clause of the database procedure definition.
Nullable variables are initialized to null. Non-nullable variables are initialized to the default value according to data type: character data types are initialized to blank, and numeric data types are initialized to zero. Any non-nullable variables declared without an explicit default value are initialized to the default value.
Valid in: DBProc, TblProc
The DECLARE statement does either of the following:
Describes a list of local variables for use in a database procedure
Defines a name for a condition to be used in handling an exception in a database procedure.
The DECLARE statement has the following format:
DECLARE variable-or-condition declaration
Last modified date: 12/06/2024