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 Host variables.
transition variable
Transition variables are defined in a trigger and refer to either the old or new values of columns of the subject table or view of a trigger. For more information about how to refer to transition variables, see CREATE TRIGGER.
SQL variable
Start of changeSQL variables are defined by an SQL compound statement in an SQL function or SQL procedure. For more information about SQL variables, see References to SQL parameters and SQL variables.End of change
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
Start of changeParameter markers are specified in an SQL statement that is dynamically prepared, instead of variables, other than global variables. For more information about parameter markers, see Parameter markers in the PREPARE statement.End of change

Unless otherwise noted, the term variable in syntax diagrams is used to describe where a host variable, transition variable, SQL variable, SQL parameter, or parameter marker can be used.