Bug #2316: 'Document contains no data' when fetching/loading empty lob values
| From: | robert dot everett at wcom dot com | Date: | Thu, 16 Sep 1999 20:58:19 +0000 |
| Subject: | Bug #2316: 'Document contains no data' when fetching/loading empty lob values | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-11012@lists.php.net to get a copy of this message | ||
From: robert.everett@wcom.com
Operating system: Solaris 2.6
PHP version: 3.0.12
PHP Bug Type: Oracle related
Bug description: 'Document contains no data' when fetching/loading empty lob values
Calling the load() method on a lob locator or calling OCIFetchInto with the OCI_RETURN_LOBS flag set
causes the error 'Document contains no data' if the value of the lob is empty (i.e.,
initialized with empty_clob() or empty_blob()). No error occurs if the value is null (i.e.,
uninitialized) or contains data.
Here are the details:
PHP 3.0.12
Apache 1.3.9
Oracle 8.0.4
Solaris 2.6
$stmt = OCIParse($conn, "insert into foobar (id, lob1, lob2) values (1, null,
empty_clob())");
OCIExecute($stmt);
OCIFreeStatement($stmt);
$stmt = OCIParse($conn, "select lob1, lob2 from foobar where id = 1");
OCIExecute($stmt);
OCIFetch($stmt);
$lob1 = OCIResults($stmt, 0);
$contents1 = $lob1->load; //**OK
$lob2 = OCIResults($stmt, 1);
$contents2 = $lob2->load; //**error occurs
OCIFreeStatement($stmt);
-- OR --
$stmt = OCIParse($conn, "select lob2 from foobar");
OCIExecute($stmt);
OCIFetchInto($stmt, &$results, OCI_RETURN_LOBS); //**error occurs
OCIFreeStatement($stmt);