Programming Guide



CONTINUE

Fetches the next set of rows associated with a default or named SELECT cursor

Synopsis

DBMS [WITH CURSOR cursor] CONTINUE

Arguments

WITH CURSOR cursor
Name of declared SELECT cursor. If the clause is not used, Panther uses the default SELECT cursor.

Description

If a SELECT statement retrieves more rows than can fit in its destination variables, Panther returns as many rows as will fit. It continues fetching more rows from the select set when the application executes this command. If there are pending rows, executing DBMS CONTINUE clears the destination variables, and fetches the next screen-full of rows from the select set. If there are no pending rows, executing DBMS CONTINUE does nothing.

If the cursor's aliases have changed between the execution of the SELECT and the execution of DBMS CONTINUE, DBMS CONTINUE uses the new settings. DBMS CONTINUE should not be used with a CATQUERY TO FILE cursor. CATQUERY TO FILE always writes out the entire select set to the CATQUERY file.

Example

// This procedure fetches the specified rows
// and calls the JPL procedure check_count.
proc get_selection
DBMS DECLARE movie_list CURSOR FOR \
SELECT * FROM titles WHERE genre_code = ::genre_code
DBMS WITH CURSOR movie_list EXECUTE USING genre_code
call check_count
return
// This procedure sets the message line according
// to the number of rows available.
proc check_count
if @dmretcode != DM_NO_MORE_ROWS
msg setbkstat "Press %KPF1 to see more films " \
"or press %KPF2 to specify another type."
else
msg setbkstat "That's all folks!"
return
// This procedure is called by pressing PF1.
// It retrieves the next set of rows.
proc get_more
DBMS WITH CURSOR movie_list CONTINUE
call check_count
return

See Also

CONTINUE_BOTTOM, CONTINUE_DOWN, CONTINUE_TOP, CONTINUE_UP, STORE