Actually there is an indirect way to do this using bulk collect:
DECLARE
TYPE ray_list IS TABLE OF energy.ray%type;
rays ray_list;
BEGIN
// ...
EXECUTE IMMEDIATE
'select ray from energy'
BULK COLLECT INTO rays;
FOR i IN 1..rays.count LOOP
EXECUTE IMMEDIATE 'SELECT :1 FROM dual' USING rays(i);
END LOOP;
END;
Don't know if that helps you.
On Mar 20, 7:30 pm, "Rob Wolfe" <[email protected]> wrote:
> On Fri, March 20, 2009 12:04, oldyork90 wrote:
>
> > Can I get away with something like this?
>
> > execute immediate ' for item in ( select ray from energy )
> > loop
> > do something
> > end loop
>
> > I haven't had any luck so far.
>
> As you have no doubt guessed... No you can't
>
> And on the topic of cursor for loops in general .. let's go to one of the
> masters Steven Feuerstein
> http://www.oracle.com/technology/oramag/oracle/08-nov/o68plsql.html
>
> it isn't quite "GO TO STATEMENT CONSIDERED
> HARMFUL"http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF but it is close.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---