Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

How to call a stored procedure from a stored function with parameter?

From: Zsolt Csillag <starhu(at)gmail.com>
Date: Sat Sep 29 2007 - 16:32:49 EDT


Hello,

I have the following stored procedure

PROCEDURE `IsProductInForeignDatabase`(IN stock INTEGER(11), OUT MyResult VARCHAR(1000), IN Behaviour VARCHAR(20))

The procedure above returns the "MyResult" out parameter.

I have a stored function as well thas has the body:

Begin
Declare MyResult VARCHAR(1000);

set MyResult = '';

call `IsProductInForeignDatabase`(1, MyResult,'question');

Do you need help?X

RETURN 50;
END; In the code above the "return 50" is only a test: if I use the "call" statement in the body then the function will return nothing at all, on the contrary when I don't use the "call" statement, then it returns 50.

The problem should be with the "MyResult" variable, but I don't know what to do.
I tried with "@" sign, with no difference.

It is interesting that if I call the procedure within an Sql window it works perfectly like this:

CALL `IsProductInForeignDatabase`(1, @w,'question'); SELECT @w;

If it worked the end of the function would be "return MyResult".

Thank you in advance

Zsolt Csillag

www.egyediszoftverek.hu
www.starsoft.hu Received on Sat Sep 29 16:33:48 2007

Do you need more help?X

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:12:51 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library