Connecting Tech Pros Worldwide Help | Site Map

SQL Server stored procedure output parameters.

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 26th, 2008, 04:55 PM
David Gillen
Guest
 
Posts: n/a
Default SQL Server stored procedure output parameters.

Hello.

I'm having difficulty getting the value of output parameters from stored
procedures on a SQL server.
I understand that this just doesn't work with odbc so I've tried both the
mssql functions route, and the PDO route. In both instances I can execute the
query and iterate over the result set, but in both cases the variable bound to
the output parameter isn't having it's value changed.

In my searches online I've come across examples of how it 'should' work, and
plenty of posts of people unable to get it to work. Is there something special
that needs to be done to have it set?

The bind calls I'm trying are (mssql and PDO respectively)
mssql_bind($stmt, '@Output', $output, SQLINT4, true);
and
$stmt->bindParam(2, $OutPut, PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT, 16);

I'm hoping someone can maybe shed some light on this, or at least point me in
a direction which has eluded me thus far.

Thanks,
David.

  #2  
Old March 27th, 2008, 05:15 PM
Erwin Moller
Guest
 
Posts: n/a
Default Re: SQL Server stored procedure output parameters.

David Gillen schreef:
Quote:
Hello.
>
I'm having difficulty getting the value of output parameters from stored
procedures on a SQL server.
I understand that this just doesn't work with odbc so I've tried both the
mssql functions route, and the PDO route. In both instances I can execute the
query and iterate over the result set, but in both cases the variable bound to
the output parameter isn't having it's value changed.
>
In my searches online I've come across examples of how it 'should' work, and
plenty of posts of people unable to get it to work. Is there something special
that needs to be done to have it set?
>
The bind calls I'm trying are (mssql and PDO respectively)
mssql_bind($stmt, '@Output', $output, SQLINT4, true);
and
$stmt->bindParam(2, $OutPut, PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT, 16);
>
I'm hoping someone can maybe shed some light on this, or at least point me in
a direction which has eluded me thus far.
>
Thanks,
David.
Hi David,

This might help a little:
http://blog.stuartherbert.com/php/20...-2005-support/

The lower section named:
What’s Wrong With The Existing MSSQL Extension For PHP?

Also, M$ is making a new driver, read more here:
http://www.microsoft.com/sql/technol...p/default.mspx

Maybe it helps using their new version.
I am NOT sure because I didn't try it yet, but read some good reviews.
If that is an option for you: Give it a shot

Please report back here with your experiences.

Regards and good luck,
Erwin Moller
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.