Collection Contents Index Declaration section [ESQL] DECLARE CURSOR statement [ESQL] [SP] pdf/chap9.pdf

Reference Manual
   CHAPTER 9. SQL Statements     

DECLARE statement


Function 

To declare a SQL variable within a compound statement (BEGIN... END).

Syntax 

DECLARE variable_name data-type

Description 

Variables used in the body of a procedure or trigger can be declared using the DECLARE statement. The variable persists for the duration of the compound statement in which it is declared.

The body of a Watcom-SQL procedure or trigger is a compound statement, and variables must be declared immediately following BEGIN. In a Transact-SQL procedure or trigger, there is no such restriction.

Standards and compatibility 

Examples 


Collection Contents Index Declaration section [ESQL] DECLARE CURSOR statement [ESQL] [SP] pdf/chap9.pdf