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.
|COMMIT and ROLLBACK|
Executing a COMMIT or ROLLBACK terminate the current transaction, thereby closing all open cursors.
The following example declares and then closes the cur_publishers cursor.
DECLARE cur_publishers CURSOR FOR SELECT * FROM publishers; CLOSE cur_publish;