Explain the two type of Cursors ?

 There are two types of cursors, Implicit  Cursor and Explicit Cursor.PL/SQL uses Implicit Cursors for queries.User  defined cursors are called Explicit Cursors. They can be declared and used.

Showing Answers 1 - 7 of 7 Answers

DHEERAJ JHA

  • Sep 25th, 2005
 

implicit cursor: implicit cursor is a type of cursor which is automatically maintained by the Oracle server itself.implicit cursor returns only one row.

Explicit Cursor: Explicit Cursor is defined by the Proframmer,and it has for phases:declare,open,fetch and close.explicit Cursor returns more than one row.

  Was this answer useful?  Yes

There r two types of cursors in the pl/sql
1.Implici 2.explicit
 For the select stmt which is retrieving single record or all the dml operations in the pl/sql program system automatically allocates the temporary memory or private area to fetch the records that is called as implicit cursor automatically created by the system.
if u r trying to fetch more than one record from the pl/sql programs we need to allocate some private area,we have to activate the records available in the cursor,we need to fetch one by one record and we have to refresh the memory for the records after fetching all the records that process will be handled by explicit cursors defined by the user

  Was this answer useful?  Yes

Cursors are of two types
1. Implicit Cursors: -  Whenever we execute sql statements oracle server assigns a work area called private sql area to store precessed infomation. The most recently used work are can be accessed using SQL%. In implicit cursors open, fetch , close operations are automatically performed by the server implicitly.

2.Explicit cursors:-   In explicit cursor  you can explicitly assign a name to process information stored in private sql areas.  This  process involves four steps

  I. Declaring a cursor :- Involves assign a name to cursor and associating a query with it..
 II. Open the cursor   :-  Executes the query and identify the result set.
 III. Fetch the cursor :-  gets the result set and Loops through to process them
 IV. Close the cursor :- Releases the cursor

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions