%SelectInit meta-SQL element

Syntax

%SelectInit(statefield1[,statefield2]...[,statefieldN])
Select field1[,field2]...[,fieldN]

The statefields must be valid fields on the state record (they may be fieldname or recordname.fieldname, as with %Bind), and fields must be either valid fields in the From tables or hard-coded values.

Description

Use the %SelectInit construct to identify the state record fields to hold the values returned by the corresponding Select statement.

The %SelectInit construct is identical to the %Select construct with the following exception: if the Select statement returns no rows, then %SelectInit re-initializes the buffers. In the case of a %Select construct where no rows are returned, the state record fields retain their previous values.

Note:

For aggregate functions, no difference exists between using %SelectInit or %Select.