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: Terje Tysse <diltert_at_NOSPAMhotmail.com>
Date: Fri, 22 Feb 2002 10:28:12 GMT
Message-ID: <i07c7usptdn3l5voi6mfl3cpi35tacjal5@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 - 04:28:12 CST

Original text of this message

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