GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 31 of 171    Print  
Difference between an implicit & an explicit cursor.
PL/SQL declares a cursor implicitly for all SQL data manipulation statements, including quries that return only one row. However,queries that return more than one row you must declare an explicit cursor or use a cursor FOR loop.
Explicit cursor is a cursor in which the cursor name is explicitly assigned to a SELECT statement via the CURSOR...IS statement. An implicit cursor is used for all SQL statements Declare, Open, Fetch, Close. An explicit cursors are used to process multirow SELECT statements An implicit cursor is used to process INSERT, UPDATE, DELETE and single row SELECT. .INTO statements.



  
Total Answers and Comments: 19 Last Update: April 22, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
  Sorting Options  
  Page 1 of 2   « First    1    2    >     Last »  
April 02, 2006 10:44:32   #1  
Rajasekar        

RE: Difference between an implicit & an explicit c...
When use SELECT INTO implicit cursor it should return one row and exactly one row. Otherwise exception will be thrown as no data found or returing more than one row.
 
Is this answer useful? Yes | No
August 23, 2006 02:05:29   #2  
siddhartha saha        

RE: Difference between an implicit & an explicit c...

begin

for x in (select * from emp) loop

.........................................;

................................;

end loop;

end;

Just tell me which type of cursor that is being used in the above example?

Is explicit or implicit?


 
Is this answer useful? Yes | No
September 02, 2006 03:06:13   #3  
paul        

RE: Difference between an implicit & an explicit c...

Ref:- sidharth

for x in (select * from amp)

loop

..................................;

...............................;

end loop;

is an explicit cursor.


 
Is this answer useful? Yes | No
September 06, 2006 16:21:05   #4  
pavani        

RE: Difference between an implicit & an explicit c...

hello

i think this is an implicit cursor.

pavani.


 
Is this answer useful? Yes | No
October 04, 2006 09:51:19   #5  
Paul Marconi        

RE: Difference between an implicit & an explicit c...
It is an implicit cursor because there is no 'cursor' keyword.
 
Is this answer useful? Yes | No
October 09, 2006 08:32:04   #6  
kamal        

RE: Difference between an implicit & an explicit c...

No vandana

that is explicit cursor


 
Is this answer useful? Yes | No
October 09, 2006 08:34:20   #7  
kamal        

RE: Difference between an implicit & an explicit c...

pavani

actually in that programme selection statement having * that is why that is explicit cursor.

thank you

kamal


 
Is this answer useful? Yes | No
October 09, 2006 14:13:59   #8  
rampratap409 Member Since: September 2006   Contribution: 111    

RE: Difference between an implicit & an explicit c...

Implicit cursor will select and return only (only) one row

like :

select ename job into v_ename v_job

from emp

where empno 7839;

Explicit cursor can have one row or multiple

like in previous example its explicit because statement may return more then one row.

another example for explict cursor:

declare

cursor c1 is select ename job sal from emp;

v_ename emp.ename type;

v_job emp.job type;

v_sal emp.sal type;

begin

open c1;

loop

fetch c1 into v_ename v_job v_sal;

exit when c1 notfound;

dbms_output.put_line(v_ename||' '|v_job||' '||v_sal);

end loop;

end;

/


 
Is this answer useful? Yes | No
November 17, 2006 00:27:05   #9  
vishal        

RE: Difference between an implicit & an explicit c...

No that is implicit cursor

coz it is used in begin part


 
Is this answer useful? Yes | No
November 25, 2006 09:15:19   #10  
Murali Krishna Nekkalapudi        

RE: Difference between an implicit & an explicit c...
Implicit cursors are created and closed by the PL/SQL engine itself. Implicit cursors are given the name SQL. However explicit cursors are user defined.
 
Is this answer useful? Yes | No
  Page 1 of 2   « First    1    2    >     Last »  


 
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