Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to create a cursor within begin end block

911338Feb 8 2012 — edited Feb 8 2012
hi all,
i need to creeate a cursor wich content depends on another cursor. how can i do that?
here an example
colonna1 varchar2(20);
cursor num_formule is
select distinct cod_output from table; 
TYPE cur IS REF CURSOR;      

begin

for colonna1 in num_formule
    loop
        open cur for 
        select fields from table2 where field1=colonna1.field;
        for colonna in cur
            loop
                sql_stmt:=sql_stmt||colonna.field;
        end loop;
        
        DBMS_OUTPUT.put_line(sql_stmt);
        
    end loop;
how can i do that?
thx
This post has been answered by Etbin on Feb 8 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 7 2012
Added on Feb 8 2012
18 comments
3,538 views