Oracle PL/SQL - PL SQL Cursor Implicit Cursors


A cursor is a pointer to data returned from a SELECT or DML statement.

An implicit cursor is a session cursor that is constructed and managed by PL/SQL.

PL/SQL opens an implicit cursor every time you run a SELECT or DML statement.

You can get information from its attributes.

The syntax of an implicit cursor attribute value is SQL% attribute.

SQL% attribute refers to the most recently run SELECT or DML statement.

If no such statement has run, the value of SQL% attribute is NULL.

An implicit cursor closes after its associated statement runs. Its attribute values remain available until another SELECT or DML statement runs.

The implicit cursor attributes are:

SQL%ISOPEN Is the Cursor Open?
SQL%FOUNDWere Any Rows Affected?
SQL%NOTFOUND Were No Rows Affected?
SQL%ROWCOUNT How Many Rows Were Affected?
SQL%BULK_ROWCOUNTHow Many Rows Were Affected?

SQL%ISOPEN Attribute: Is the Cursor Open?

SQL%ISOPEN always returns FALSE, because an implicit cursor always closes after its associated statement runs.

Related Topics