They are also created when a SELECT statement that returns just one row is executed.
They must be created when you are executing a SELECT statement that returns more than one row.
The following illustration shows the execution cycle of an explicit cursor: Let’s examine each step in detail.
Before using an explicit cursor, you must declare it in the declaration section of a block or package as shown below: is the name of the cursor declared in the declaration section.
As the result, Oracle created PL/SQL cursor to provide these extensions.
A PL/SQL cursor is a pointer that points to the result set of an SQL query against database tables.
More about parameterized cursor in the next tutorial.
I have been told these types of operations are what SQL Server is designed to process and it should be quicker than serial processing. I assume Microsoft created them for a reason so they must have a place where they can be used in an efficient manner.
This temporary work area is used to store the data retrieved from the database, and manipulate this data.
A cursor can hold more than one row, but can process only one row at a time.
The fetch action retrieves data and fills the record or the variable list. You can fetch the data until there is no record found in active result set.
The syntax of LOOP -- fetch information from cursor into record FETCH cur_chief INTO r_chief; EXIT WHEN cur_chief%NOTFOUND; -- print department - chief DBMS_OUTPUT.