References to variables
A variable in an SQL statement specifies a value
that can be changed when the SQL statement is executed. There are several
types of variables used in SQL statements:
- host variable
- Host variables are defined by statements of a host language. For more
information about how to refer to host variables see References to host variables.
- transition variable
- Transition variables are defined in a trigger and refer to either the
old or new values of columns. For more information about how to refer to transition
variables see CREATE TRIGGER.
- SQL variable
- SQL variables are defined by an SQL compound statement in an SQL function,
SQL procedure, or trigger. For more information about SQL variables, see References to SQL parameters and SQL variables.
- SQL parameter
- SQL parameters are defined in an CREATE FUNCTION (SQL Scalar),
CREATE FUNCTION (SQL Table), or CREATE PROCEDURE (SQL) statement. For more
information about SQL parameters, see References to SQL parameters and SQL variables.
- parameter marker
- Variables cannot be referenced in dynamic SQL statements.
Parameter markers are defined in an SQL descriptor and used instead. For more
information about parameter markers, see Parameter Markers.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.