|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58499 Real db2 datatype is not supported by extension
Submitted: 2009-01-10 11:29 UTC Modified: 2009-03-09 06:26 UTC
From: kolar dot radim at gmail dot com Assigned:
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 5.2.4 OS: Ubuntu 8.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
20 - 10 = ?
Subscribe to this entry?

 [2009-01-10 11:29 UTC] kolar dot radim at gmail dot com
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:
function print_array($res) {
	foreach($res as $key => $val) {
	 echo "$key -- $val \n";
$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");
echo "Real value\n";
$res=db2_exec($dbcon,"SELECT tz_offset from test1R");

$res=db2_exec($dbcon,"DROP TABLE TEST1R");
$res=db2_exec($dbcon,"DROP TABLE TEST1F");

Expected result:
Float value
Real value

Actual result:
Float value
Real Value
TZ_OFFSET 1.59220141196E-314


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-12 02:10 UTC] abhargav at in dot ibm dot com

Thanks for reporting this. I will get back to you once it is fixed.

Ambrish Bhargava
 [2009-03-09 06:26 UTC] abhargav at in dot ibm dot com
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Dec 05 14:03:37 2021 UTC