What are the attributes of oracle cursors?
The Oracle cursor has the following attributes:
- %FOUND is used to determine if the most recent FETCH statement successfully retrieved a record. It returns TRUE if a record was retrieved successfully, otherwise it returns FALSE.
- %NOTFOUND is used to determine if a FETCH statement did not retrieve any record, opposite to %FOUND. It returns TRUE when no record was retrieved, otherwise it returns FALSE.
- %ROWCOUNT: Returns the number of records affected by the most recent DML statement executed (such as INSERT, UPDATE, or DELETE).
- %ISOPEN is used to determine if a cursor is already open. It returns TRUE if the cursor is open, otherwise it returns FALSE.
- %BULK_ROWCOUNT: Returns the number of processed records for each binding variable in a BULK COLLECT statement.
These attributes can be used for cursor condition judgment, record counting, and other operations.