Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

30 views
Skip to first unread message

gamaz

unread,
Dec 3, 2002, 4:40:56 PM12/3/02
to
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>


Sybrand Bakker

unread,
Dec 3, 2002, 6:25:46 PM12/3/02
to


PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
READ THOSE MANUALS!
WHAT IS THE CORRECT SYNTAX TO CALL A PROCEDURE WITHIN A PROCEDURE.
THE ANSWER IS IN YOUR PL/SQL REFERENCE MANUAL!!!!!!!
DOES IT INCLUDE USING 'EXECUTE'?
IS EXECUTE A PL/SQL KEYWORD?


Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address

Karsten Farrell

unread,
Dec 3, 2002, 7:12:12 PM12/3/02
to
Change 'execute proc_test5' in line 9 to 'proc_test5'. The 'execute' is
a sqlplus command, not a plsql command. Welcome to Oracle! :)

gamaz

unread,
Dec 3, 2002, 7:34:26 PM12/3/02
to
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" <kfar...@belgariad.com> wrote in message
news:wLbH9.921$4t7.16...@newssvr13.news.prodigy.com...

gamaz

unread,
Dec 3, 2002, 7:40:59 PM12/3/02
to
Hello Sybrand,
It sounds that you are guru of Oracle. I would appreciate if you try to
act like a real guru ( I assume that you know the real meaning of guru). Did
you see that you wasted more time in your censure than supplying the needed
information. By the way, I am from sql server environment and old habits do
creep in occasionally. Hope you understand and not make sweeping judgement
about others.
Regards.

"Sybrand Bakker" <gooid...@sybrandb.demon.nl> wrote in message
news:n8fquucq0886p3pba...@4ax.com...

Sybrand Bakker

unread,
Dec 4, 2002, 12:50:15 AM12/4/02
to
On Wed, 04 Dec 2002 00:40:59 GMT, "gamaz" <ga...@eathlink.net> wrote:

> By the way, I am from sql server environment and old habits do
>creep in occasionally. Hope you understand and not make sweeping judgement
>about others.
>Regards.


This group has demonstrated many times before that people brainwashed
by sqlserver *NEVER* read *ANY* manual, and misuse this group as a
*FIRST* resource, instead of trying to find the solution themselves.
It is *quite clear* you do the same. So you will *NEVER* learn to use
Oracle, without someone holding your hand.

Brian E Dick

unread,
Dec 4, 2002, 8:48:37 AM12/4/02
to
Sql Server is hardly the reason for people not reading manuals. The same
people probably didn't read the Sql Server manuals either and pestered the
daylights out of the Sql Server newsgroup.

It's just plain laziness and inconsideration.

"Sybrand Bakker" <gooid...@sybrandb.demon.nl> wrote in message

news:9p5ruu87i7uou00ai...@4ax.com...

0 new messages