| help me on CURSOR [message #429612] |
Wed, 04 November 2009 14:19  |
nchaitu Messages: 2 Registered: November 2009 Location: india |
Junior Member |
|
|
Can anyone help me in understanding how many times the select statement will be executed in below program?
What exactly the cursor c1 holds? data set returned by select statement or the parsed select statement?
If it holds the parsed select statement then the parsed statement is going to be executed each time we fetch from cursor c1?
declare
v_ename varchar2(30);
cursor c1 is select ename from emp;
begin
open c1;
loop
fetch c1 into v_ename;
exit when c1%notfound;
dbms_output.put_line(v_ename);
end loop;
close c1;
end;
[Updated on: Wed, 04 November 2009 14:29]
|
|
|
| Re: help me on CURSOR [message #429622 is a reply to message #429612] |
Wed, 04 November 2009 15:03   |
Michel Cadot Messages: 29436 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
SQL is executed only once, cursor "contains" the execution and where in this execution plan the statement is.
Database Concepts
Chapter 24 SQL, PL/SQL, and Java
Section Overview of SQL
Paragraph SQL Processing/SQL Statement Execution
Regards
Michel
|
|
|
|