#43887 [Com]: mssql2005 PROCEDURE PDO::PARAM_INPUT_OUTPUT

From: Date: Thu, 30 Oct 2008 08:56:26 +0000
Subject: #43887 [Com]: mssql2005 PROCEDURE PDO::PARAM_INPUT_OUTPUT
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-130304@lists.php.net to get a copy of this message
 ID:               43887
 Comment by:       miha dot vrhovnik at domenca dot si
 Reported By:      coldgrass at gmail dot com
 Status:           Open
 Bug Type:         PDO related
 Operating System: windows xp
 PHP Version:      5.2.5
 New Comment:

Can confirm this on Linux.

PHP 5.2.6, connecting to MSSQL 2000 via freetds 0.82RC4

Guys please fix that I had to revert back to mssql_* functions for
calling stored procedures. So Now half of project uses PDO the other
half the old functional style...


Previous Comments:
------------------------------------------------------------------------

[2008-01-18 08:32:38] coldgrass at gmail dot com

Description:
------------
environment:php5.2.5,mssql server 2005 
I can't retrieve stored procedure return values

Reproduce code:
---------------
$sth = $DB->prepare('exec proc_getDeviceNumByHdType
:inpara,:usetable,:num');
$sth->bindParam(":inpara", $para, PDO::PARAM_STR);
$sth->bindParam(":usetable", $paraTable, PDO::PARAM_STR);
$sth->bindParam(":num", $return,
PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT,1);
$sth->execute();

	create procedure [dbo].[proc_getDeviceNumByHdType] 
		@hdtype as varchar(256),
		@usetable varchar(50),
		@num int output 
	AS
	begin
		DECLARE @sql Nvarchar(1000)

		SET  @sql = N'SELECT @num=COUNT(*) from  '+CAST(@usetable AS
NVARCHAR(50)) 
		EXECUTE sp_executesql @sql,N'@num int output',@num output
	end

Expected result:
----------------
after call procedure ,there is no return value;

Actual result:
--------------
should have a value;


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43887&edit=1



Thread (7 messages)

« previous php.bugs (#130304) next »