#35973 [Opn->Fbk]: Error ORA-24806 occur when trying to fetch a NCLOB field
ID: 35973
Updated by: tony2001@php.net
Reported By: webmaster at f1-timer dot de
-Status: Open
+Status: Feedback
Bug Type: OCI8 related
Operating System: Linux, Solaris
PHP Version: 5.1.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-01-12 00:56:12] webmaster at f1-timer dot de
Description:
------------
Trying to fetch data from an Oracle 9i Database, the Table has a NCLOB
field which cannot be read via PHP, a normal CLOB field however works.
The table structure is:
CREATE TABLE NCLOB_TEST
(
MYCLOB NCLOB
);
And it simply contains one line of text with content '12345'
I've tested this behavour with PHP 5.1.1 (Linux and Solaris) and 4.1.1
(only Linux), always give the same result.
Reproduce code:
---------------
<?php
$query = 'SELECT MYCLOB FROM NCLOB_TEST';
//oci_internal_debug(1);
$sock = OCILogon('SCOTT','TIGER');
$stmt = OCIParse($sock,$query);
OCIExecute($stmt,OCI_DEFAULT);
OCIFetchInto($stmt,$resultarray,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS);
print_r($resultarray);
// Now try to load the clob with descriptor:
OCIExecute($stmt,OCI_DEFAULT);
OCIFetchInto($stmt,$resultarray,OCI_ASSOC);
print_r($resultarray);
$lobcontent = $resultarray['MYCLOB']->load();
OCIFreeStatement($stmt);
print_r($lobcontent);
OCILogoff($sock);
exit;
?>
Expected result:
----------------
Array
(
[MYCLOB] => '12345'
)
Array
(
[MYCLOB] => '12345'
)
Actual result:
--------------
PHP Warning: ocifetchinto(): OCILobRead: ORA-24806:
LOB-Formfehlanpassung
in /spare/html/private/PHP-Classes/OCI8/bugzilla_php.php on line 8
Warning: ocifetchinto(): OCILobRead: ORA-24806: LOB-Formfehlanpassung
in /spare/html/private/PHP-Classes/OCI8/bugzilla_php.php on line 8
Array
(
[MYCLOB] =>
)
Array
(
[MYCLOB] => OCI-Lob Object
(
[descriptor] => Resource id #8
)
)
PHP Warning: OCI-Lob::load(): OCILobRead: ORA-24806:
LOB-Formfehlanpassung
in /spare/html/private/PHP-Classes/OCI8/bugzilla_php.php on line 16
Warning: OCI-Lob::load(): OCILobRead: ORA-24806: LOB-Formfehlanpassung
in /spare/html/private/PHP-Classes/OCI8/bugzilla_php.php on line 16
PS: The Error is in english "LOB form mismatch" and is described from
Oracle as below:
netra:/opt/apache2/conf# oerr ora 24806
24806, 00000, "LOB form mismatch"
// *Cause: When reading from or writing into LOBs, the character set
// form of the user buffer should be same as that of the LOB.
// *Action: Make sure that the buffer you are using to read or write
// has the same form as that of the LOB.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35973&edit=1
Thread (6 messages)