dbTalk Databases Forums  

Call Procedure inside other Procedure

comp.databases.mysql comp.databases.mysql


Discuss Call Procedure inside other Procedure in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Felipe Aron
 
Posts: n/a

Default Call Procedure inside other Procedure - 02-23-2011 , 01:22 PM






I Need to call one procedure inside other procedure:

MainProcedure
begin

...
call AnotherProcedure();

end

Try this method but MySQL dont accept. And Now?

Reply With Quote
  #2  
Old   
Lennart Jonsson
 
Posts: n/a

Default Re: Call Procedure inside other Procedure - 02-23-2011 , 02:27 PM






On 2011-02-23 20:22, Felipe Aron wrote:
Quote:
I Need to call one procedure inside other procedure:

MainProcedure
begin

...
call AnotherProcedure();

end

Try this method but MySQL dont accept. And Now?
You will have to be a bit more specific on what error you encounter. In
general it is no problem calling one procedure from another:

mysql> delimiter @
mysql> create procedure a(in x int, out y int)
-> begin
-> SET y = x + 1;
-> end;
-> @
Query OK, 0 rows affected (0.03 sec)

mysql> create procedure b(in u int, out v int)
-> begin
-> call a(u, v);
-> end;
-> @
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;
mysql> call b(10, @result);
Query OK, 0 rows affected (0.00 sec)

mysql> select @result;
+---------+
Quote:
@result |
+---------+
11 |
+---------+
1 row in set (0.00 sec)

/Lennart

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.