|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57486 db2_result() on CLOB columns returns empty string
Submitted: 2007-01-18 12:16 UTC Modified: 2007-02-12 15:07 UTC
From: jtray at us dot ibm dot com Assigned: kfbombar (profile)
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 5.2.0 RC4 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jtray at us dot ibm dot com
New email:
PHP Version: OS:


 [2007-01-18 12:16 UTC] jtray at us dot ibm dot com
The PHP version is 5.2.0 (not available in the select box above).

db2_result() called on a CLOB column in a result set returns empty string.

I tried it on with the DLL that Kellen sent 01/17/2007 04:54 PM, and the version at

Reproduce code:

/** CLOB testcase

include_once 'dbinfo.include';

$conn = null;
try {
  $conn = db2_pconnect
     array("autocommit" => DB2_AUTOCOMMIT_OFF));
  if ($conn == false)
    throw new Exception('CONNECT failed');
  $ps = db2_exec($conn, 'drop table clobtest');
  $ps = db2_exec($conn, 
		 'create table clobtest (name varchar (80) not null primary key, value clob(80) logged not compact not null)');

  $ps = db2_exec($conn, "insert into clobtest (name, value) values ('hello', 'world')");

  $res = db2_exec($conn, 'select * from clobtest');

  print "<pre>Results:\n";

  while (db2_fetch_row($res)) {
    $name = db2_result($res, 'NAME');
    $value = db2_result($res, 'VALUE');
    print 'name = "' . $name . '", value = "' . $value . "\"\n";

  print 'end of results</pre>';

catch (Exception $e)
  if ($conn !== null)
  print '<pre>ERROR: ' . $e . '</pre>';

Expected result:
name = "hello", value = "world"
end of results

Actual result:
name = "hello", value = ""
end of results

DB2 command-line results:
db2 => select * from johngalt.clobtest




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-12 15:07 UTC] kfbombar at us dot ibm dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jun 25 01:01:23 2021 UTC