php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58143 db2_fetch_both: Problems fetching CLOB fields
Submitted: 2008-04-04 14:17 UTC Modified: 2008-06-09 10:17 UTC
From: eacosta at openware dot biz Assigned:
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 4.4.8 OS: OpenSUSE 10.2
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: eacosta at openware dot biz
New email:
PHP Version: OS:

 

 [2008-04-04 14:17 UTC] eacosta at openware dot biz
Description:
------------
Hello,

I've been facing difficulties with walk a big number of records from a result set.

I am using the function db2_fetch_both in a method of a database adapter class to retrieve just one record at a time. The total number of records are: 5647 and when I reach record number 1600 the function crashed generating the below message in "Actual result" field.

I am copying table's description next:

TMP_TABLE
-----------------------------------------------------------------
| ID		| TYPE		| SIZE		| NULL		|
-----------------------------------------------------------------
| ID		| INTEGER	| 4		| NO		|
| SERVICE	| VARCHAR	| 30		| NO		|
| ID_v		| VARCHAR	| 30		| NO		|
| INFORMATION	| CLOB		| 65536		| YES		|
| EXP_LEVEL	| INTEGER	| 4		| NO		|
| IP4B		| BIGINT	| 8		| NO		|
| MODIFIED	| INTEGER	| 4		| YES		|
| DETAIL	| VARCHAR	| 200		| YES		|
| FALSPOS	| INTEGER	| 4		| YES		|
-----------------------------------------------------------------

I would like to notice you this database class adapter's method comes from "CodeCharge Studio 3.1" (http://www.codecharge.com) a well-know PHP Rapid Development Programme.

I can't give you more details about our PHP Server configuration for security reasons. I hope you understand it.

Thank you,

-- 
Esteban Acosta Villafa?e
R+D Department
http://www.openware.biz
Linkein Profile: http://www.linkedin.com/in/estebanav

Reproduce code:
---------------
  function next_record() {
    if (!$this->Query_ID)
      return 0;
    $this->Record = db2_fetch_both($this->Query_ID) ;
    $this->Row += 1;

    $stat = is_array($this->Record);
    if (!$stat && $this->Auto_Free) {
      $this->free_result();
    }
    return $stat;
  }

Expected result:
----------------
Return true or false and assign a record to Record instance property and incremented 1 Row instance property.

Actual result:
--------------
db2_fetch_array() [function.db2-fetch-array]: Fetch Failure

Patches

Pull Requests

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 02:01:35 2025 UTC