Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: [Q] Generic programming
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;
>
---Received on Fri Oct 03 1997 - 00:00:00 CDT
> --- Martin Jesterhoudt
> --- martinj(replace this by @)worldonline.nl
>
---------------------------------------------------------------------------- ---
>
![]() |
![]() |