ENDSELECT
Valid in: ESQL
The ENDSELECT statement terminates a SELECT loop.
The ENDSELECT statement has the following format:
EXEC SQL ENDSELECT;
The ENDSELECT statement terminates embedded OpenSQL select loops
. A select loop is a block of code delimited by begin and end statements and associated with a select statement
. As the select statement retrieves rows from the database, each row is processed by the code in the select loop
. (For more information about select loops, see
SELECT (interactive).) When the ENDSELECT statement is executed, the program stops retrieving rows from the database and program control is transferred to the first statement following the select loop.
The ENDSELECT statement must be inside the select loop that it is intended to terminate. If an ENDSELECT statement is placed inside a forms statement code block that is syntactically nested within a select loop, the statement ends the nested construct as well as the select loop.
The statement must be terminated according to the rules of the host language.
To find out how many rows were retrieved before the ENDSELECT statement was issued, check the sqlerrd(3) variable of the SQLCA.
Last modified date: 08/28/2024