You are here: Re: [PHP] mssql_*() functions and stored procedures « PHP « IT news, forums, messages
Re: [PHP] mssql_*() functions and stored procedures

Posted by Jochem Maas on 10/11/05 21:52

Chris Boget wrote:
> 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;

in firebird I would do something like:

SELECT result FROM MySP

maybe that works for you in mssql?

>
> 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

is it possible to start a transaction first then run the 2 queries?

> getting an error w/r/t variable declaration?
>
> thnx,
> Christoph
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация