When an SQL statement is used, the Oracle server allocates a large block of memory to parse and execute SQL commands. This workspace is a cursor.
When the execution part of a block contains an SQL statement, PL/SQL creates an implicit cursor and manages the cursor on its own. The display cursor must beProgramThe member explicitly declares and names them.
In PL/SQL, a cursor generally has four attributes. the attribute of an SQL cursor can be used to verify the output results of an SQL statement.
- SQL % rowcount. Returns the number of records affected by the last SQL statement (integer ).
- SQL % found. Boolean attribute. When the cursor or cursor variable is opened but before the fetch statement is executed, % found is NUL. After that, if the last fetch statement returns one or more rows of records, % found is true. If the fetch statement does not return a record, % found is false.
- SQL % notfound. Boolean attribute. When the cursor or cursor variable is opened but before the fetch statement is executed, % notfound is null. After that, if the last fetch statement returns a row of records, % notfound is false. If the fetch statement does not return a record, % notfound is true.
- SQL % isopen. True when the cursor or cursor variable is opened; otherwise false.