January 2002
Intermediate to advanced
640 pages
16h 39m
English
Closes a previously defined cursor object.
CLOSE cursorcursorThe name of a currently open cursor that you wish to close.
CLOSEThe message returned when the cursor is successfully closed.
NOTICE: PerformPortalClose: portal "cursor" not foundThe notice returned if the specified cursor
is either not declared, or not open.
The CLOSE command closes an open cursor and frees the resources it was
using. Cursors should always be closed after they are no longer needed. Once a cursor is
closed, further operations are not allowed on it.
Executing a COMMIT or ROLLBACK terminates the
current transaction, closing all open cursors.
The following example opens a transaction, declares the cur_publishers
cursor, and closes it:
booktown=# BEGIN; BEGIN booktown=# DECLARE cur_publishers CURSOR FOR SELECT * FROM publishers; SELECT booktown=# CLOSE cur_publishers; CLOSE