GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 12 of 166    Print  
what is cursor? Explain the types of cursor and write one implicit cursor program to check how many records deleted from table?

  
Total Answers and Comments: 6 Last Update: April 23, 2009     Asked by: indranil 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Jawwad Malvi
 

The Cursor is a handle (name or a pointer) for the memory associated with a specific statement.  A cursor is basically an Area alocated by Oracle for executing the Sql Statements.  Oracle Uses an Implicit Cursor statement for a single row query and Explicit Cursor for a multi row query.

Types of Cursor :

I) Implicit

II) Explicit (Explicit cursor has three sub-types)

1)  Simple Cursor

2)  Parameterised Cursor

3) Ref Cursor



Above answer was rated as good by the following members:
pankajjo
February 13, 2006 23:52:50   #1  
Jawwad Malvi        

RE: what is cursor? Explain the types of cursor and wr...

The Cursor is a handle (name or a pointer) for the memory associated with a specific statement. A cursor is basically an Area alocated by Oracle for executing the Sql Statements. Oracle Uses an Implicit Cursor statement for a single row query and Explicit Cursor for a multi row query.

Types of Cursor :

I) Implicit

II) Explicit (Explicit cursor has three sub-types)

1) Simple Cursor

2) Parameterised Cursor

3) Ref Cursor


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
April 23, 2006 02:27:55   #2  
Divesh        

RE: what is cursor? Explain the types of cursor and wr...
declare num number(10);begin delete from ; num : sql rowcount; dbms_output.put_line('Number of rows deleted arr : ' || num );end;please free to contact me on dibansal@cisco.com if you have any queries
 
Is this answer useful? Yes | No
May 02, 2007 20:53:49   #3  
KiranKW Member Since: May 2007   Contribution: 7    

RE: what is cursor? Explain the types of cursor and wr...
Hi

Hi

Please find the explanation below....

CURSOR

A cursor is a variable that runs through the tuples of some relation. This relation can be a stored table or it can be the answer to some query.

There are different types of cursors but broadly classified into two :

Implicit cursor
Explicit cursor.

Every query that we issue on a database is an implicit cursor for eg. a select an update a delete etc.

On the otherhand explicit cursor is a user defined cursor eg: cursor explicit_cur as ...... ;


 
Is this answer useful? Yes | No
August 27, 2007 01:37:05   #4  
jiten        

RE: what is cursor? Explain the types of cursor and wr...
Cursor is a private SQL memory area. Generally it is used to improve to performance of the system.

Implicit cursor name is SQL .

If you can used any DML statement in your plsql code.
At last you use SQL cursor name with its attributes so that you will meaning full information.

like

SQL ROWCOUNT which gives how many rows are affected by this plsql block.

 
Is this answer useful? Yes | No
June 27, 2008 23:05:14   #5  
chetanpunjabi Member Since: June 2008   Contribution: 1    

RE: what is cursor? Explain the types of cursor and write one implicit cursor program to check how many records deleted from table?

Implicit and Explicit.

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 manages automatically. The programmer explicitly declares and names an explicit cursor.


 
Is this answer useful? Yes | No
April 20, 2009 07:35:33   #6  
mailtonagaraja Member Since: April 2009   Contribution: 1    

RE: what is cursor? Explain the types of cursor and write one implicit cursor program to check how many records deleted from table?
A cursor is a handle (pointer) in memory for a DML operation (Select Update).

There are mainly 2 types of cursors .
1) Implicit Cursor.
2) Explicit Cursor.

Implicit cursor: Oracle will implicitly creates an area for the DML operations. Programmer will not have control on implicit cursors. The only useful attribute on this implicit cursor is SQL ROWCOUNT it will give the number of rows affected by the recent DML operation.

The only Implicit cursor is SQL.

Explicit Cursor:
Explicit cursors are created by the programmer and programmer have control on it
Programmer can

1) Open


2) Close

3) Fetch

and do some manipulations on the values

Explicit Cursors are classified into

1) Normal cursor

2) Parameterized cursor

3) Cursor For Loops and

4) REF cursors

REF Cursors:

Normally when we create a normal cursor we cant change the select query associated to that query (the query which is given at the time of definition)

But using REF cursors we can change the cursor statement also.


These REF cursors are useful when we are sending data from one environment to another environment.


Thanks And Regards

Nagaraja.Musturi


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape