Programming Guide



START

Specifies a starting row in a SELECT set

Synopsis

DBMS [ WITH CURSOR cursor ] START [ int ]

Arguments

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

int
Number indicating the row at which to begin the fetch.

Description

By default, when a select set contains more than one row, Prolifics fetches them sequentially beginning with the first row in the select set. Use DBMS START to be gin fetching at row int. Prolifics reads and discards int - 1 rows from the select set before returning the requested rows to the application. If the application is counting the rows fetched, the discarded rows do not update @dmrowcount. If int is greater than the number of rows in the select set, no rows are displayed.

The setting is turned off by executing DBMS START with no arguments. Closing a cursor also turns off the setting. If a cursor is redeclared without being closed, the cursor continues to use the setting for SELECT statements.

Example

proc discard_100
DBMS START 100
DBMS SQL SELECT * FROM actors
if @dmrowcount == 0
msg emsg "There are less than 100 rows."
DBMS START
return