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

Home -> Community -> Usenet -> c.d.o.server -> Re: Executing a procedure from within another procedure dynamically

Re: Executing a procedure from within another procedure dynamically

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 24 Nov 1999 15:51:33 -0500
Message-ID: <psjo3s4c8bai8qfdo1oas64csg2m2arjk3@4ax.com>


A copy of this was sent to Don Del Grande <del_grande_at_netvista.net> (if that email address didn't require changing) On Wed, 24 Nov 1999 17:59:58 GMT, you wrote:

>I'm using V7.3. Is there any way to call a stored procedure from
>within another stored procedure WITHOUT hard-coding the name in the
>first stored procedure?
>
>I tried:
>DBMS_SQL.PARSE(c, 'EXECUTE ' || procedure_name, DBMS_SQL.v7)
>("c" is the return value from an OPEN_CURSOR; "procedure_name" is a
>VARCHAR2 containing the name of an existing procedure)
>but it returned an ORA-00900 error ("Invalid SQL statement").
>
>
>

it would be 'begin ' || procedure_name || '; end;'

execute is a sqlplus shorthand for that. if you generate an error, you can see what i mean:

tkyte_at_8.0> execute not_a_procedure
begin not_a_procedure; end;

      *
ERROR at line 1:

ORA-06550: line 1, column 7:
PLS-00201: identifier 'NOT_A_PROCEDURE' must be declared
ORA-06550: line 1, column 7:

PL/SQL: Statement ignored

>----------------------------------------------------------------
>Sure, the Navy could maintain its own news servers, or we could save
>the money and pass the savings onto the taxpayers (or, for example,
>certain taxpayers planning on running for the Senate in New York) by
>using...
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Nov 24 1999 - 14:51:33 CST

Original text of this message

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