Programming Guide



CLOSE CURSOR

Closes a named or default cursor

Synopsis

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

Arguments

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

WITH CONNECTION connection
Name of connection having the default 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 FILE, 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

Prolifics automatically declares another default SELECT cursor when needed.

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

DBMS CLOSE CURSOR cursor
DBMS WITH CURSOR cursor CLOSE CURSOR

Closing a connection also 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 SQL SELECT title_id, name, film_minutes, pricecat \
FROM titles
DBMS CLOSE CURSOR

See Also

DBMS DECLARE CURSOR, dm_is_cursor