Professional Documents
Culture Documents
Introduction
• Oracle creates a memory area called Context area when SQL statement
is processed.
• Context area is a memory region inside the Process Global Area
• A cursors is the pointer to context area.
• Cursor contain all the information needed to processed SQL statements.
• A cursor holds the rows (one or more) returned by a SQL statement.
• Types of Cursors:
Implicit cursor: Automatically generated by oracle whenever a SQL
statement is processed. Programmers cannot control the implicit cursors
and the information in it.
Explicit Cursors: Explicit cursor is user-defined cursor . It is
Declared explicitly by developer and it can be manipulated.
SQL Cursor Attributes
PL/SQL Explicit cursor syntax
• Explicit cursors are programmer-defined cursors for gaining
more control over the context area.
• An explicit cursor should be defined in the declaration section
of the PL/SQL Block. It is created on a SELECT Statement
which returns more than one row.
• The syntax for creating an explicit cursor is −
CURSOR cursor_name IS select_statement;
Working with Explicit cursor