From: coldgrass at gmail dot com
Operating system: windows xp
PHP version: 5.2.5
PHP Bug Type: PDO related
Bug description: mssql2005 PROCEDURE PDO::PARAM_INPUT_OUTPUT
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 bug report at http://bugs.php.net/?id=43887&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43887&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43887&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43887&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43887&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43887&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43887&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43887&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43887&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43887&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43887&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43887&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43887&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43887&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43887&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43887&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43887&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43887&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43887&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43887&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43887&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43887&r=mysqlcfg