Programming Guide



WITH CURSOR

Uses a named cursor for the duration of a statement

Synopsis

DBMS WITH CURSOR cursor DBMSstatement

Arguments

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

DBMSstatement
Text of the DBMS command.

Description

The DBMS WITH CURSOR clause specifies the name of a declared cursor on which Panther executes the DBMS command. Once a cursor is declared, the application can manipulate or execute the cursor by using the WITH CURSOR clause in the following commands:

DBMS WITH CURSOR cursor ALIAS ...
DBMS WITH CURSOR cursor CATQUERY ...
DBMS WITH CURSOR cursor COLUMN_NAMES
DBMS WITH CURSOR cursor CONTINUE
DBMS WITH CURSOR cursor CONTINUE_BOTTOM
DBMS WITH CURSOR cursor CONTINUE_TOP
DBMS WITH CURSOR cursor CONTINUE_UP
DBMS WITH CURSOR cursor EXECUTE ...
DBMS WITH CURSOR cursor FORMAT ...
DBMS WITH CURSOR cursor OCCUR ...
DBMS WITH CURSOR cursor START ...
DBMS WITH CURSOR cursor STORE ...
DBMS WITH CURSOR cursor UNIQUE ...

If the DBMS WITH CURSOR clause is not used with these commands, Panther uses the default SELECT cursor. The application can also manipulate the default cursor by using the DBMS WITH CONNECTION clause.

Some engine-specific DBMS commands can also support the WITH CURSOR clause. For more information, refer to "Database Drivers."

Example

// Uses colon expansion on the cursor name to remove
// the command attributes for named cursors.
proc cursor_refresh (cursor_name)
DBMS WITH CURSOR :cursor_name ALIAS
DBMS WITH CURSOR :cursor_name CATQUERY
return 0

See Also

DECLARE CURSOR, CLOSE CURSOR, dm_is_cursor