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: How can I dynamically execute a procedure name?

Re: How can I dynamically execute a procedure name?

From: marcie <marcie.tietjen_at_westgroup.com>
Date: 15 Aug 2002 10:29:11 -0700
Message-ID: <899474e5.0208150929.23ef70a4@posting.google.com>


Thomas Gaines <Thomas.Gaines_at_noaa.gov> wrote in message news:<3D5A8399.6B3FE36E_at_noaa.gov>...
> Marcie -
>
> I struggled with something similar until I realized that you really
> can't use "execute" inside of PL/SQL code. Instead, use the PL/SQL
> "begin" and "end" and put your call to the procedure in between.
>
> Here's a snippet of code from one of my procedures:
> <snip>
> stmt := 'begin osei.evall(' || jobno || '); end;';
> execute immediate stmt;
>
> In this case, evall is a procedure in the osei schema. I obtained
> jobno earlier in my PL/SQL, assembled the statement that executes
> the procedure, and then executed it. It works well.
>
> Bye,
> Tom
>
>

Tom -- I just wanted to say thanks - this worked great. I also had to find a way to pass variables to my procedure but with a little help from a co-worker I got that working too. Thanks for the help!

execute 'procedure_name' and send value 'time_type'

 exec_ps := 'begin '||procedure_name||'('||time_type||');end;';  execute immediate exec_ps; Received on Thu Aug 15 2002 - 12:29:11 CDT

Original text of this message

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