#39161 [Opn->Asn]: parameter names not sent to prepared statement
| From: | iliaa@php.net | Date: | Sun, 15 Oct 2006 16:19:26 +0000 |
| Subject: | #39161 [Opn->Asn]: parameter names not sent to prepared statement | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103565@lists.php.net to get a copy of this message | ||
ID: 39161
Updated by: iliaa@php.net
Reported By: aspen dot olmsted at alliance dot biz
-Status: Open
+Status: Assigned
Bug Type: PDO related
Operating System: windows xp sp 2
PHP Version: 5CVS-2006-10-15 (snap)
-Assigned To:
+Assigned To: wez
Previous Comments:
------------------------------------------------------------------------
[2006-10-15 15:35:42] aspen dot olmsted at alliance dot biz
Description:
------------
If I call a SQL 2000 stored procedure through pdo odbc in a prepared
statement it will not set the proper field order if the order does not
match the parameter order in the SP.
Reproduce code:
---------------
2000 SQL SP (can be empty):
create procedure pdo_test2 @Param1 int, @Param2 varchar(100) as
PHP Code:
$a["param1"] = '26050';
$a["param2"] = 'test';
$sql = "exec pdo_test2 @param2 = :param2,@param1 = :param1";
$stmt = $dbh->prepare($sql);
$x = $stmt->execute($a);
Expected result:
----------------
The column order should not matter if the names are passed
Actual result:
--------------
If I trace in sql I see the following:
exec sp_prepare @P1 output, N'@Param1 int,@Param2 varchar(100)', N'exec
pdo_test2 @param2 = @Param1,@param1 = @Param2', 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39161&edit=1