|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-28 20:39 UTC] nate-php at seekio dot com
[2005-12-28 21:06 UTC] tony2001@php.net
[2005-12-29 01:02 UTC] nate-php at seekio dot com
[2005-12-29 01:20 UTC] tony2001@php.net
[2005-12-29 01:32 UTC] nate-php at seekio dot com
[2005-12-29 10:08 UTC] sniper@php.net
[2006-04-09 07:41 UTC] wez@php.net
[2006-04-17 01:00 UTC] php-bugs at lists dot php dot net
[2006-05-08 03:22 UTC] nate-php at seekio dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 12:00:01 2025 UTC |
Description: ------------ In PHP 5.1.1 bind variables no longer seem to work with the ODBC PDO driver connecting to DB2. The same code that worked fine in 5.1.0 and previous now throws an exception in 5.1.1 and php5.1-200512222130 CVS snapshot: The query I'm running is: insert into nate.testdb values (?, ?) The table is specified as: create table tb.testdb (a int, b varchar(50)) Exception at line 13 of file testdb.php: SQLSTATE[22005]: Error in assignment: -99999 [IBM][CLI Driver] CLI0112E Error in assignment. SQLSTATE=22005 (SQLExecute[-99999] at /usr/local/src/php-5.1.1/ext/pdo_odbc/odbc_stmt.c:133) I looked up the db2 error code CLI0112E and this is what it said: CLI0112E Error in assignment. Explanation: The data sent for a parameter or column was incompatible with the data type of the associated table column. User Response: Respecify the output binding through SQLBindCol or SQLGetData or the input binding through SQLSetParam or SQLBindParameter. Reproduce code: --------------- try { $db = new PDO('odbc:sample', 'webdb', 'xxx'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { die("Connect failed: " . $e->getMessage() . "\n"); } try { $query = "insert into nate.testdb values (?, ?)"; $sth = $db->prepare($query); $sth->execute(array(1, 'foobar')) } catch (Exception $e) { die("Exception at line " . $e->getLine() . " of file " . $e->getFile() . ": " . $e->getMessage() . "\n"); } Expected result: ---------------- a row is inserted with the values of 1, and foobar in the a and b columns Actual result: -------------- Exception at line 13 of file testdb.php: SQLSTATE[22005]: Error in assignment: -99999 [IBM][CLI Driver] CLI0112E Error in assignment. SQLSTATE=22005 (SQLExecute[-99999] at /usr/local/src/php-5.1.1/ext/pdo_odbc/odbc_stmt.c:133) and no row is inserted.