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

Home -> Community -> Usenet -> c.d.o.misc -> Re: [Q] Generic programming

Re: [Q] Generic programming

From: Tina Tran <tinat_at_sonica.com>
Date: 1997/10/03
Message-ID: <01bcd048$a5470910$2aaeb6cc@dino>#1/1

Use dynamic SQL provided by the dbms_sql package.

replace this with @Martin Jesterhoudt <martinjxs4all.nl> wrote in article <34316031.3059639_at_news.xs4all.nl>...
> Hello,
>
> PROBLEM:
> I want to call a procedure by using a variable as procedurename, but
> don't know if this is possible. Can someone give me a hint? Thanks in
> advance...
>
> EXAMPLES:
> (which doesn't work):
>
> declare
> cursor c_procs is
> select procedure_name
> from project_procedures;
> begin
> for r_procs in c_procs loop
> EXEC r_procs.procedure_name -- <<<<< THIS LINE NEEDS MODIFICATION
> end loop;
> end;
>
> For obvious reasons, I don't want to use something like this:
>
> declare
> ...
> begin
>
> for r_procs in c_procs loop
>
> if r_procs.procedure_name = 'STARTUP' then
> STARTUP;
> elsif r_procs.procedure_name = 'NEXTPROC' then
> NEXTPROC;
> else
> EXITPROC;
> end if;
>
> end loop;
>
> end;
>


---

> --- Martin Jesterhoudt
> --- martinj(replace this by @)worldonline.nl
>
---------------------------------------------------------------------------- ---
>
Received on Fri Oct 03 1997 - 00:00:00 CDT

Original text of this message

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