473,396 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.
Mar 26 '08 #1
1 4688
David Gillen schreef:
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
Mar 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steve Holden | last post by:
Has anyone, with any driver whatsoever, managed to retrieve output parameters from a SQL Server stored procedure? I've just been rather embarrassed to find out it's not as easy as it might seem,...
1
by: ivan divandelen | last post by:
Hi, How can i pass a parameter SQL stored Procedure from ASP pages
3
by: Michael | last post by:
This one's really got me. I have a VB.NET (version 1.1.4322) project that provides an easy way to execute stored procedures on a generic level. When I run the code on computer A (running SQL...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
3
by: Bilbo | last post by:
I have a a headscratcher here: I have a form that when submitted should do 2 things when a user enters data and then clicks the Add button. Here goes: 1. Call a stored procedure called...
4
by: Mr Not So Know It All | last post by:
im new to SQL Server and ASP.Net. Here's my problem. I have this SQL Server stored procedure with an input parameter and output parameter CREATE PROCEDURE . @in_rc varchar(8) @out_eList...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
2
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
12
by: Light | last post by:
Hi all, I posted this question in the sqlserver.newusers group but I am not getting any response there so I am going to try it on the fine folks here:). I inherited some legacy ASP codes in my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.