Oracle Cursor property : %FOUND: Variables finally get records from the cursor when a record in the result set found . %NOTFOUND: Variables last from the cursor gets record when, in the result set has no records found . %ROWCOUNT: Current moment from the cursor gets record number . %ISOPEN: Is open .
When executing a DML statement, DML statements results in setting the four cursor attributes, these attributes are used to control program flow, or understand the state of the program. When you run DML statements, PL / SQL to open a built-in cursor and process the results, the cursor is to maintain the query results in a memory area, the cursor open when you run DML statements, complete closure. Implicit cursors using only SQL% FOUND, SQL% NOTFOUND, SQL% ROWCOUNT three properties. SQL% FOUND, SQL% NOTFOUND is a Boolean value, SQL% ROWCOUNT is an integer value.
SQL% FOUND and SQL% NOTFOUND
Before performing any DML statement in SQL% FOUND and SQL% NOTFOUND of the values are NULL, the implementation of DML statement, SQL% FOUND attribute value will be:
. TRUE: INSERT
. TRUE: DELETE and UPDATE, DELETE, or at least one line is UPDATE.
. TRUE: SELECT INTO returns at least one line
When the SQL% FOUND is TRUE, SQL% NOTFOUND to FALSE.
Before performing any DML statement, SQL% ROWCOUNT value is NULL, the SELECT INTO statement, if executed successfully, SQL% ROWCOUNT value of 1, if not successful, SQL% ROWCOUNT is 0, while producing an exception NO_DATA_FOUND .
SQL% ISOPEN is a Boolean value, if the cursor is opened, for the TRUE, if the cursor is closed, compared to FALSE. For the purposes of the implicit cursor SQL% ISOPEN always FALSE, because the implicit cursor open in the DML statement is executed, immediately turn off the end.