(Contents)(Previous)(Next)

Dynamic FETCH Statements

To be able to assign variables values that have been selected by means of a dynamic SQL statement, the dynamic FETCH statement is available. The values of the current row of the specified result table are assigned to the variables marked by ':' (local or global variables or vector slices).

If no result table is specified, the FETCH statement refers to the result table last generated. Within the result table, the current row can be determined with FIRST, LAST, NEXT, PREV or POS (:<num expr>). FIRST positions to the first row of the result table, LAST to the last; NEXT to the next row after the current row, PREV to the preceding row. The numeric expression specified with POS determines the position of the row within the order of the result table.

Example:

At translation time it cannot be checked whether the number of variables agrees with the number of selected columns.

Syntax:


(Contents)(Previous)(Next)