Oracle® Database PL/SQL Language Reference 11g Release 2 (11.2) Part Number E10472-02 |
|
|
View PDF |
An implicit cursor has attributes that return information about the most recently run SELECT
or DML statement that is not associated with a named cursor.
Topics:
Syntax
implicit_cursor_attribute ::=
Semantics
%ISOPEN
SQL%ISOPEN
always has the value FALSE
.
%FOUND
SQL%FOUND
has one of these values:
If no SELECT
or DML statement has run, NULL
.
If the most recent SELECT
or DML statement returned a row, TRUE
.
If the most recent SELECT
or DML statement did not return a row, FALSE
.
%NOTFOUND
SQL%NOTFOUND
has one of these values:
If no SELECT
or DML statement has run, NULL
.
If the most recent SELECT
or DML statement returned a row, FALSE
.
If the most recent SELECT
or DML statement did not return a row, TRUE
.
%ROWCOUNT
SQL%ROWCOUNT
has one of these values:
If no SELECT
or DML statement has run, NULL
.
If a SELECT
or DML statement has run, the number of rows fetched so far.
SQL%BULK_ROWCOUNT
A composite attribute for use with the "FORALL Statement". This attribute acts like an associative array. Its ith element stores the number of rows processed by the ith execution of an UPDATE
or DELETE
statement. If the ith execution affects no rows, SQL%BULK_ROWCOUNT(
i
)
has the value zero. For more information, see "Counting Rows Affected by FORALL".
Restriction on SQL%BULK_ROWCOUNT You cannot assign the value of SQL%BULK_ROWCOUNT(
index
)
to another collection or pass it as a parameter to a subprogram.
SQL%BULK_EXCEPTIONS
A composite attribute for use with a FORALL
statement that has a SAVE
EXCEPTIONS
clause (see "FORALL Statement"). This attribute acts like an associative array that stores information about any exceptions raised while the FORALL
statement ran. For each index value i between 1 and SQL%BULK_EXCEPTIONS
.COUNT
:
SQL%BULK_EXCEPTIONS(
i
)
.ERROR_INDEX
specifies which iteration of the FORALL
loop caused an exception.
SQL%BULK_EXCEPTIONS(
i
)
.ERROR_CODE
specifies the Oracle Database error code that corresponds to the exception.
For more information, see "Effect of FORALL Exceptions on Rollbacks" and "Handling FORALL Exceptions".
Usage
You can use cursor attributes in procedural statements, but not in SQL statements.
Examples
Related Topics
In this chapter:
In other chapters: