Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL ?
PL/SQL ? [message #2093] Thu, 20 June 2002 11:19 Go to next message
Samuel Jenkins
Messages: 3
Registered: June 2002
Junior Member
Can u have nested cursors in pl/sql.
Re: PL/SQL ? [message #2095 is a reply to message #2093] Thu, 20 June 2002 12:37 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Sure. Either with explicit cursors or cursor for loops (preferred).

open c1:
loop
  fetch c1 into something;
  exit when c1%notfound;
  open c2;
  loop
    fetch c2 into something_else;
    exit when c2%notfound;
    -- do something
  end loop;
  close c2;
end loop;
close c1;


or

for r1 in c1 loop
  for r2 in c2 loop
    -- do something
  end loop;
end loop;
Re: PL/SQL ? [message #2097 is a reply to message #2093] Thu, 20 June 2002 12:42 Go to previous message
Samuel Jenkins
Messages: 3
Registered: June 2002
Junior Member
Thanks.
Previous Topic: Re: ora-12560, tns:protocol adapter error
Next Topic: is the database UP ?
Goto Forum:
  


Current Time: Fri Apr 26 20:54:47 CDT 2024