|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-07-28 11:42 UTC] simonslaws at googlemail dot com
[2006-10-10 23:11 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 03:00:01 2025 UTC |
Description: ------------ Installed Windows 5.1.4 on discovering error but made no difference. hence using php_pdo_odbc.dll version 5.1.4.4 Tried against the following databases UDB2 version 8.1 DB2(zOS) Version 8 Cloudscape version 10.1 All failed Unless the DOUBLE field contains a NULL then OK. Note replacing PDO with db2_connect does not generate the error. Reproduce code: --------------- Create table tableA CREATE TABLE APP.tableA( NAME CHAR(30) NOT NULL, fldA DOUBLE, fldB INTEGER, PRIMARY KEY(name) ); Insert a row: insert into APP.tableA (NAME,fldA ,fldB ) Values('Baz',3,2000); Execute a select statement like 'Select fldA, fldB from APP.tableA' Where field fldA is created as a DOUBLE and fldB is an INTEGER. or Cast any valid field to a DOUBLE seems to generate the error. 'Select CAST(fldB as DOUBLE) as testfld from tableA' example code: try { $dbh = new PDO($constrng, $user, $pass); echo 'Connected'; } catch (PDOexception $exp) { echo 'Exception: ' . $exp->getMessage(); } $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "Select fldA, fldB from APP.tableA;"; $sth = $dbh->prepare($sql, array(PDO::ATTR_CURSOR,PDO::CURSOR_FWDONLY)); $sth->execute(); print "results for $sql \n\n"; $rows = $sth->fetchAll(); print_r($rows); Actual result: -------------- Returns the following error message. SQLSTATE[22003]: Numeric value out of range: -99999 [IBM][CLI Driver] CLI0111E Numeric value out of range. SQLSTATE=22003 (SQLFetchScroll[-99999] at ext\pdo_odbc\odbc_stmt.c:372)