Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: how would you do it?

Re: how would you do it?

From: Eugene <epipko_at_gmail.com>
Date: 15 Dec 2006 15:00:54 -0800
Message-ID: <1166223654.768701.166430@16g2000cwy.googlegroups.com>


Thanks for reply,
However, I need to be able to run a procedure which name is a part of the cursor-for-loop.
For instance:
............
for x in (select seq,proc from table t order by seq) loop

     <execute x.proc here>
end loop

...........................

This way if structure of the table changes, no additional code needed.

I hope it makes sense

On Dec 15, 2:47 pm, "klabu" <klab..._at_gmail.com> wrote:
> "Eugene"
>
>
>
>
>
> > Hi all,
> > I have a table with 2 columns:
> > seq proc
> > ------ -------------------------
> > 1 sales_order_p;
> > 2 po_p;
> > 3
> > ........
>
> > I need to be able to loop via all records in that table (ordered by
> > seq) end execute each procedure.
> > Is it possible? Do I use "execute immediate"?
> > I want to make is dinamic enough so if another procedure will be added
> > OR I will have to resequence table, no extra maintenance will be
> > required.I'd probly concatenance and do a
> "execute immediate" on a anon block like this:
>
> begin
> sales_order_p;
> po_p;
> invoice_p;
> end ;- Hide quoted text -- Show quoted text -
Received on Fri Dec 15 2006 - 17:00:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US