php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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
Description:
------------
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 http://pecl4win.php.net/download.php/ext/5_2/5.2.1/php_ibm_db2.dll


Reproduce code:
---------------
<?php

/** CLOB testcase
 */

include_once 'dbinfo.include';

$conn = null;
try {
  $conn = db2_pconnect
    (RB_DATABASE, RB_USERID, RB_PASSWORD, 
     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')");

  db2_commit($conn);
  
  $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>';

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


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

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

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

NAME
 VALUE

--------------------------------------------------------------------------------
 -------------------------------------------------------------------------------
-
hello
 world


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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 pecl.php.net.

In case this was a pecl.php.net 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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 18:01:28 2024 UTC