|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-01-12 02:10 UTC] abhargav at in dot ibm dot com
[2009-03-09 06:26 UTC] abhargav at in dot ibm dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 10:00:02 2025 UTC |
Description: ------------ db2 datatype 'REAL' is not supported by ibm_db2 PHP extension. Reading data of that type returns bogus values. Tested against IBM DB2 LUW 9.5.3 Reproduce code: --------------- <?php function print_array($res) { foreach($res as $key => $val) { echo "$key -- $val \n"; } } $dbcon=db2_connect("test","phorum","p"); $res=db2_exec($dbcon,"CREATE TABLE TEST1R (TZ_OFFSET REAL)"); $res=db2_exec($dbcon,"CREATE TABLE TEST1F (TZ_OFFSET FLOAT)"); $res=db2_exec($dbcon,"INSERT INTO TEST1R VALUES(-2.34)"); $res=db2_exec($dbcon,"INSERT INTO TEST1F VALUES(-2.34)"); echo "Float value\n"; $res=db2_exec($dbcon,"SELECT tz_offset from test1F"); $result=db2_fetch_assoc($res); print_array($result); echo "Real value\n"; $res=db2_exec($dbcon,"SELECT tz_offset from test1R"); $result=db2_fetch_assoc($res); print_array($result); $res=db2_exec($dbcon,"DROP TABLE TEST1R"); $res=db2_exec($dbcon,"DROP TABLE TEST1F"); ?> Expected result: ---------------- Float value TZ_OFFSET -2.34 Real value TZ_OFFSET -2.34 Actual result: -------------- Float value TZ_OFFSET -2.34 Real Value TZ_OFFSET 1.59220141196E-314