Programming Guide |
Changes the behavior of a
SELECT
cursor that writes to Panther arrays
DBMS [WITH CURSORcursor
] OCCURoccInt
[MAXint
]DBMS [WITH CURSORcursor
] OCCUR CURRENT [MAXint
]
WITH CURSOR
cursor
- Name of declared
SELECT
cursor. If the clause is not used, Panther uses the defaultSELECT
cursor.occInt
- Occurrence number where Panther should begin placing
SELECT
results.CURRENT
- Specifies that Panther use the occurrence number of the "current" field. Panther begins writing at this occurrence number in the target arrays. The current field is the one containing the Panther screen cursor and is not necessarily a target variable.
MAX
int
- Specify maximum number of rows to fetch for a
SELECT
orCONTINUE
. Ifint
is less than 1, no rows are fetched.
By default, if the destination of a
SELECT
is one or more arrays, Panther fetches as many rows as will fit in the arrays and begins writing at the first occurrence in the arrays.DBMS OCCUR
changes this default behavior for aSELECT
cursor.The setting is turned off by executing the
DBMS OCCUR
command 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 forSELECT
statements andCONTINUE
commands.
DBMS OCCUR
is ignored with aCATQUERY
cursor.
// When executed, this procedure starts writing
// the result set at the current occurrence.proc select_type
DBMS DECLARE genre_cursor CURSOR FOR \
SELECT * FROM titles WHERE genre_code = :+code
DBMS WITH CURSOR title_cursor OCCUR CURRENT
DBMS WITH CURSOR title_cursor EXECUTE
return