Closing a cursor v16
Once all the desired rows are retrieved from the cursor result set, close the cursor. After you close the cursor, you can no longer access the result set.
The CLOSE
statement appears as follows:
name
is the identifier of a cursor that's currently open. After you close a cursor, don't close it again. However, after you close the cursor, you can use the OPEN
statement again on the closed cursor and rebuild the query result set. After that, the FETCH
statement can then retrieve the rows of the new result set.
This example uses the CLOSE
statement:
This procedure produces the following output. Employee number 7369, SMITH
is the first row of the result set.