Previous Topic: Applying the Select ListNext Topic: FROM Clause


INTO Clause

Introduces a list of host variables.

host-variable

INTO

Must name a variable that is described in the program in accordance with the rules for declaring host variables. The names must be separated by commas.

The first value in the result row is assigned to the first variable in the list, the second value to the second variable, and so on. If the number of values is not the same as the number of variables, the value W is assigned to SQLCA-WARNING(4).

The data type of a variable must be compatible with the value assigned to it. If the value is numeric, the variable must have the capacity to represent the integral part of the value. If the value is null, an indicator variable must be specified.

Each assignment to a variable is made according to the rules described in Basic Operations (Assignment and Comparison). Assignments are made in sequence through the list. If an assignment error occurs for some variable, no value is assigned to that variable or later variables. Any values that have already been assigned to variables remain assigned.