Avatar of BILL Carlisle
BILL Carlisle
Flag for United States of America

asked on 

Want to use one of two cursors in same for loop

Hi,
I want to use one of two cursors in same for loop as follows but my syntax is off

declare
   d number:=2;
   rec_type
begin
if(d=3)then
    cursor xyz is
       select 'g' col1,'h' col2,'j' col3,'k' col4 from dual;
else
    cursor xyz is
       select '2g' col1,'2h' col2,'2j' col3,'2k' col4 from dual;
end if;

for rec in xyz loop
   htp.p(rec.col1||' -- '||rec.col2||' -- '||rec.col3||' -- '||rec.col4 );

end loop;
end;
Oracle Database

Avatar of undefined
Last Comment
slightwv (䄆 Netminder)

8/22/2022 - Mon