DECLARE VARIABLE

From InterBase

Go Up to Procedures and Triggers


Declares a local variable. Available in triggers and stored procedures.

DECLARE VARIABLE var data_type;
Argument Description

<var>

Name of the local variable, unique within the trigger or procedure

<data_type>

Data type of the local variable; can be any InterBase data type except arrays.

Description: Local variables are declared and used within a stored procedure. They have no effect outside the procedure.

Local variables must be declared at the beginning of a procedure body before they can be used. Each local variable requires a separate DECLARE VARIABLE statement, followed by a semicolon (;).

Example: The following header declares the local variable, ANY_SALES:

CREATE PROCEDURE DELETE_EMPLOYEE (EMP_NUM INTEGER)
AS
DECLARE VARIABLE ANY_SALES INTEGER;
BEGIN
. . .

See Also

Advance To: