Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
| Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 4th, 2004, 08:51 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Oracle, PHP and the f*cking NCLOBs

Hey fellas, here's a tricky one 4 u.
Using PHP5 with Apache2.0.49 under RedHat 9, connected with Oracle9.2.0.4
I connect to a table of my DB, do a simple select and try to display result.
Problem is that the field i try to get is an NCLOB.
here's my code :

$myCon = ocilogon("user","password","myDatabase");
$stmt = ociparse($myCon, "select myField from myTable");
    // myField is the NCLOBociexecute($stmt, OCI_DEFAULT);
?>
<table border="0" cellpadding="1" cellspacing="2" width="50%">
  <tr>
    <td align="center">myField</td>
  </tr>
<?
while (ociFetch($stmt)) {
?>
  <tr valign="top">
    <td>
      <pre>
<?
    $result = ociResult($stmt,1);
        if (is_object ($result)) {
            echo $result->load();
            // also tried : echo $result->read($result->size());
    }
?>
      </pre>
    </td>
<?
}
?>
  </tr>
</table>

And this is what i get :

Warning: OCI-Lob::read() [[u]function.read</u>]: OCILobRead: ORA-24806: LOB form mismatch in... (bla bla bla)

What the ????

Ok, now guys...your call.
show me wat U got ?

By the way :
- database in UTF-
- apache default charset : UTF-
- php default charset : UTF-

enjoy !
__________________
php/java developer
NTIC engineer
 
Old August 5th, 2004, 08:05 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

btw...
case you would've asked.
I -of course- enabled multiByte Strings in PHP and set properly NLS_LANG (=.AL32UTF8) ...

According 2 me, it cannot be done.
My way to do it is to re-create tables, changing the NCLOB in2 LONG (up to 2Go, that'd b enough 4 me)
and i say re-create and not alter because that wouldn't work fine ("kkblobr" exception...who defined that name ?)

If u think there must b a way...i'm all listening.

And 4 the Xperts, i know using LONG in this case would be deprecated, but seems better than using NCLOB...because it really feels "not precated yet".




Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to Oracle with PHP atcs2152 PHP Databases 0 December 16th, 2005 08:57 AM
php oracle select timbal25 PHP Databases 1 July 2nd, 2004 06:46 AM
PHP VS Oracle junemo PHP Databases 9 June 16th, 2004 06:23 AM
Using PHP to connect to Oracle cooldude87801 Oracle 2 June 4th, 2004 12:43 AM
oracle and php shakim Oracle 0 September 24th, 2003 09:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.