|
-
when running this test code it fails giving me the invalid cursor error,
why?
the book says that the cursor must be closed outside the loop but the explnation is not getting into my skull(maybe i'm tired) that the since the cursor is closed the 2nd row fetch will return an error... can somebody pls expl why??
SQL> declare
2 v_ename emp.ename%type:='no name';
3 cursor c1 is
4 select ename
5 from emp;
6 begin
7 open c1;
8 loop fetch c1 into v_ename;
9 if c1%notfound
10 then exit;
11 else
12 dbms_output.put_line(v_ename);
13 end if;
14 close c1;
15 end loop;
16 end;
17 /
thanx in adv...
Tarry
Tarry Singh
I'm a JOLE(JavaOracleLinuxEnthusiast)

--- Everything was meant to be---
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|