mssql_*() functions and stored procedures
| From: | Chris Boget | Date: | Tue, 11 Oct 2005 14:38:02 +0000 |
| Subject: | mssql_*() functions and stored procedures | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-223899@lists.php.net to get a copy of this message | ||
Looking through the documentation, I see that I can use
mssql_init()
mssql_bind()
mssql_execute()
to execute those stored procedures that have parameters.
But what about those SPs which just return a value? If I
have the following SP
CREATE PROCEDURE MySP
AS
DECLARE @resultCode int
SELECT @resultCode = 539
RETURN @resultCode
GO
And execute the above as follows
DECLARE @result int;
EXEC @result = MySP;
PRINT @result;
within Query Analyzer, how do I emulate this using the mssql_*()
functions? Whenever I try to just run the EXEC, I keep getting an
error message saying that I have to declare the @result variable.
I've tried to declare the variable in a seperate mssql_query() call
but that doesn't seem to have an effect. So how can I do this w/o
getting an error w/r/t variable declaration?
thnx,
Christoph