Name

SET CLOSECURSOR

Synopsis

The CLOSECURSOR setting controls whether SQL*Plus closes the cursor used to execute a SQL statement after the statement has executed.

Syntax

SET CLOSECUR[SOR] {OFF | ON}

Parameters

SET CLOSECUR[SOR]

Is the command, which may be abbreviated SET CLOSECUR.

OFF

Causes SQL*Plus to leave the cursor open for use by subsequent SQL statements. This is the default setting.

ON

Causes SQL*Plus to close the cursor after a SQL statement has been executed.

While you normally think of a cursor only in the context of returning data from a SELECT statement, Oracle also uses cursors to execute other SQL statements, such as DELETE, INSERT, UPDATE, etc. The same cursor can be used to execute many SQL statements, so SQL*Plus leaves it open all the time by default.

Get Oracle SQL*Plus: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.