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: Indirect Procedure call

Re: Indirect Procedure call

From: R.A.Collins <rcollins_at_packet.news.com>
Date: Fri, 22 Feb 2002 12:08:35 -0500
Message-ID: <UUud8.2147$T_.17783@iad-read.news.verio.net>


THANKS Terje;

    This is exactly what I was looking for!

        Ray Collins

"Terje Tysse" <diltert_at_NOSPAMhotmail.com> wrote in message news:i07c7usptdn3l5voi6mfl3cpi35tacjal5_at_4ax.com...
> On Thu, 21 Feb 2002 09:22:10 -0500, "R.A.Collins"
<rcollins_at_packet.news.com>
> wrote:
>
> >Hi, I am new to Oracle and am porting some stored procedures from another
> >DB. The problem I am having is this - Some of the procedures take in
> >parameters and use those parameters as calls for other procedures. Is
there
> >a way to use a parameter as a indirect procedure call in the body of a
> >procedure??
>
> Tit depends on the Oracle-version. In 8i and up (I'm not sure in 8) you
can do
> it like this :
>
> PROCEDURE proc1
> (
> p_subproc IN VARCHAR2 ,
> p_value IN VARCHAR2
> )
> IS
> BEGIN
> EXECUTE IMMEDIATE ( 'BEGIN '||p_subproc||'('''||p_value||'''); END;' ) ;
> END ;
>
> PROCEDURE proc2
> (
> p_value IN VARCHAR2
> )
> IS
> BEGIN
> dbms_output.put_line ( p_value ) ;
> END ;
>
> This will execute like this in SQL*Plus :
>
> C012HOME:orcl>exec proc1 ( 'PROC2' , 'TESTING' ) ;
> TESTING
>
> Regards,
> Terje Tysse
>
Received on Fri Feb 22 2002 - 11:08:35 CST

Original text of this message

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