my ref cursor variable is v_cour and type is sys_refcursor but when i run the above prgm it comes error as invalid cursor... please correct above query??
1 declare
2 v_cour sys_refcursor;
3 v_stat varchar2(20);
4 begin
5 country_info(22,'pa','');
6 loop
7 fetch v_cour into v_stat;
8 exit when v_cour%notfound;
9 dbms_output.put_line(v_stat);
10 end loop;
11* end;
SQL>
SQL> /
declare
*
ERROR at line 1:
ORA-01001: invalid cursor
ORA-06512: at line 7
Loading
sathish jPosted Sep 6, 2012, 9:11 AM
You defined the cursor without its value, assign the cursor value as like this
(ex) OPEN v_cour FOR select * from tableA;