Types of Cursors
0
Types of Cursors:
There are two types of cursors
There are two types of cursors
- Implicit cursors
- Explicit cursors
Implicit cursors:
- It is a CURSOR that is automatically declared by oracle every time an SQL statement is executed.
- These are created or erased automatically.
- These are identified by SQL%<cursor attribute>
- Whenever you issue a SQL statement, the Oracle server opens an area of memory in which the command is parsed and executed. This area is called a cursor.
- When the executable part of a block issues a SQL statement, PL/SQL creates an implicit cursor, which PL/SQL managers automatically.
- A CURSOR is automatically associated with every DML statement.
- All UPDATE and DELETE statements have cursors that identify the set of rows that will be affected by the operations.
- During processing of an IMPLICIT cursor, oracle automatically performs the operations like “OPEN”,”FETCH”, and “CLOSE” of the context area.
Explicit Cursor:
- Explicit cursors are explicitly declared by the programmer.
- This cursor is declared within the PL/SQL block, and allows sequential process of each row of the returned data from database.
0 comments: