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: Error while trying to call a stored procedure from inside another stored procedure.

Re: Error while trying to call a stored procedure from inside another stored procedure.

From: gamaz <gamaz_at_eathlink.net>
Date: Wed, 04 Dec 2002 00:34:26 GMT
Message-ID: <m4cH9.2979$hM3.352975@newsread2.prod.itd.earthlink.net>


Thanks a lot Karsten,
I appreciate your help. Since I am new to Oracle, sometimes, in a hurry, I do not realize the syntax is the issue. In any event, this is of great help. Regards.

"Karsten Farrell" <kfarrell_at_belgariad.com> wrote in message news:wLbH9.921$4t7.16355559_at_newssvr13.news.prodigy.com...
> gamaz wrote:
> > Hi,
> > I have written a stored procedure which compiles and executes fine on
its
> > own. Now I need to
> > run this stored procedure n times while n is being a supplied value.
> > This second stored procedure I created is basically executing a loop and
the
> > number of times
> > of execution is the number supplied to this stored procedure. This
stored
> > procedure calls the
> > first stored procedure. However, this cannot execute the first procedure
(it
> > seems to me) and it
> > gives an error.
> > Any help/advise is appreciated in advance. I am attaching the source as
well
> > as error code. I also
> > made sure that the first procedure can be executed manually and it does.
> >
> > SQL> create procedure loop_execute (loop_num in number)
> > 2 AS
> > 3 BEGIN
> > 4 DECLARE i number;
> > 5 BEGIN
> > 6
> > 7 WHILE i <= loop_num
> > 8 LOOP
> > 9 EXECUTE proc_test5;
> > 10 END Loop;
> > 11 END;
> > 12 END;
> > 13 /
> >
> > Warning: Procedure created with compilation errors.
> >
> > SQL> show errors
> > Errors for PROCEDURE LOOP_EXECUTE:
> >
> > LINE/COL ERROR
>
> -------- -----------------------------------------------------------------
> > 9/11 PLS-00103: Encountered the symbol "PROC_TEST5" when expecting
one
> > of the following:
> > := . ( @ % ; immediate
> > The symbol ":=" was substituted for "PROC_TEST5" to continue.
> >
> >
> > SQL> EXECUTE proc_test5;
> >
> > PL/SQL procedure successfully completed.
> >
> > SQL>
> >
> >
> Change 'execute proc_test5' in line 9 to 'proc_test5'. The 'execute' is
> a sqlplus command, not a plsql command. Welcome to Oracle! :)
>
>
Received on Tue Dec 03 2002 - 18:34:26 CST

Original text of this message

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