ID:               35973
 Updated by:       [EMAIL PROTECTED]
 Reported By:      webmaster at f1-timer dot de
-Status:           Assigned
+Status:           Analyzed
 Bug Type:         OCI8 related
 Operating System: Linux, Solaris
 PHP Version:      5CVS-2006-01-14 (snap)
 Assigned To:      tony2001
 New Comment:

Heh, interesting.. OCIAttrGet() says its SQLT_CLOB, not SQLT_NCLOB,
thus I don't see any chance to know what exactly to pass as the last
parameter to OCILobRead().


Previous Comments:
------------------------------------------------------------------------

[2006-01-12 23:03:18] [EMAIL PROTECTED]

Assigned to the maintainer.

------------------------------------------------------------------------

[2006-01-12 12:24:32] webmaster at f1-timer dot de

Tried this with php5.1-200601120930 but still got the error (Warning:
ocifetchinto(): ORA-24806: LOB form mismatch in
/html/PHP-Classes/OCI8/nclob.php on line 14)

However I found a workaround to continue developing, I've changed the
query from

"SELECT MY_NCLOB_FIELD FROM MY_TABLE" 

to 

"SELECT TO_CHAR(MY_NCLOB_FIELD) AS NC FROM MY_TABLE"

which works fine, same when using the TO_NCHAR() function. Only when
the plain NCLOB field is selected the error occures.

------------------------------------------------------------------------

[2006-01-12 10:47:16] [EMAIL PROTECTED]

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



------------------------------------------------------------------------

[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

Reply via email to