|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-06-13 04:57 UTC] cem@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 06:00:01 2025 UTC |
Description: ------------ PHP 5.1.2 SDO 1.0.1 DB2 8.2FP12 When creating a a new row in a simple table $das->applyChanges () returns with SQLSTATE 22005 indicating that it thinks that there is a type missmatch between the expected column types and the provided column types. It should be noted that this example works with PHP 5.1.4 so maybe this is just a case of pointing out that this problem can arrise with PHP 5.1.2 Reproduce code: --------------- Simple table -- CREATE TABLE "INTEROP"."ALLTYPE" ( CREATE TABLE "SIMON"."ALLTYPE" ( "ASMALLINT" SMALLINT NOT NULL , "AINT" INT, "AVARCHAR" VARCHAR(14)) IN "USERSPACE1" ; ALTER TABLE "SIMON"."ALLTYPE" ADD PRIMARY KEY ("ASMALLINT"); Simple test to read data and insert a row // Describe the structure of the alltype table $alltype_table = array('name' => 'alltype', 'columns' => array('asmallint', 'aint', 'avarchar'), 'PK' => 'asmallint'); ... // construct the SQL query for alltype retrieval $stmt = "select asmallint, aint, avarchar from alltype"; // execute the query to retrieve the departments $root = $das->executeQuery($dbh, $stmt); ... //create a new row in the table $newrow = $root -> createDataObject('alltype'); // set the properties $newrow->asmallint = $count; $newrow->aint = 4; $newrow->avarchar = 'PHP XP'; $das->applyChanges($dbh, $root); Gives rise to follwoing error. The test code works fine on MySQL so it would seem that there is something suspect about the SDO/PDO ODBC/DB2 path SDO/DAS/Relational.php::applyChanges encountered an error when attempting to exe cute INSERT INTO alltype (asmallint,aint,avarchar) VALUES (?,?,?); PDO reported no rows affected by the SQL statement. This may happen if the data that was retrieved and updated has been changed by a nother processs in the database in the meantime. The error information returned from PDO::errorInfo() was: SQLSTATE: 22005 Driver-specific error code: -99999 Driver-specific error message: [IBM][CLI Driver] CLI0112E Error in assignment . SQLSTATE=22005 (SQLExecute[-99999] at ext\pdo_odbc\odbc_stmt.c:133) All changes have been rolled back.<br/><br/> Expected result: ---------------- I expected a new row to be added to the database Actual result: -------------- Failed with SQLSTATE 22005 indicating that DB2 thinks that there is a type missmatch between the expected column types and the provided column types.