Programming Guide



CLOSE CURSOR

Closes a named or default cursor

Synopsis

DBMS CLOSE CURSOR [cursor]
DBMS WITH CONNECTION connection CLOSE CURSOR [cursor]
DBMS WITH CURSOR cursor CLOSE CURSOR

Arguments

cursor
Name of cursor to be closed. If cursor is not listed, Panther closes the default SELECT cursor.

WITH CONNECTION connection
Name of connection having the cursor to be closed.

WITH CURSOR cursor
Name of cursor to be closed.

Description

DBMS CLOSE CURSOR closes an open cursor. Closing a cursor frees all structures associated with the cursor.

Closing a cursor turns off all attributes assigned to the cursor with the DBMS commands: ALIAS, CATQUERY, COLUMN_NAMES, FORMAT, OCCUR, START, STORE, TYPE, and UNIQUE.

To close the default SELECT cursor on the default connection, specify:

DBMS CLOSE CURSOR

To close the default SELECT cursor on a specific connection, specify:

DBMS WITH CONNECTION connection CLOSE CURSOR

Panther will automatically declare another default SELECT cursor if needed.

To close a named cursor, specify either of the following:

DBMS CLOSE CURSOR cursor
DBMS WITH CURSOR cursor CLOSE CURSOR

Closing a connection first closes all cursors associated with the connection.

Example

// Assign a catquery and aliases to the default SELECT
// cursor. Close the cursor when finished.
DBMS CATQUERY TO FILE titlelist
DBMS ALIAS title_id "Title ID", name "Title",\
film_minutes "Length", pricecat "Price Category"
DBMS QUERY SELECT title_id, name, film_minutes, pricecat \
FROM titles
DBMS CLOSE CURSOR

See Also

DECLARE CURSOR, dm_is_cursor