VALUES INTO

The VALUES INTO statement assigns one or more values to host variables.

Invocation

This statement can only be embedded in an application program. It is an executable statement that cannot be dynamically prepared.

Authorization

EXECUTE authority is needed on any user-defined function that is referenced in the VALUES statement.

Syntax

VALUES {{expression | NULL} | {expression | NULL}[,...]} INTO host-variable[,...]

Description

VALUES

Introduces one or more values. If more than one value is specified, the list of values must be enclosed within parentheses.

expression Must not include a column name.
NULL The null value. NULL can only be specified for host variables that have an associated indicator variable.

INTO

Introduces one or more host variables. The values that are specified in the VALUES clause are assigned to these host variables. The first value specified is assigned to the first host variable, the second value to the second host variable, and so on.

host-variable Identifies a variable that is described in the program according to the rules for declaring host variables.

Example:

Assign the value of the CURRENT PATH special register to host variable HV1.

EXEC SQL VALUES(CURRENT PATH)
    INTO :HV1;