Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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%">
    <td align="center">myField</td>
while (ociFetch($stmt)) {
  <tr valign="top">
    $result = ociResult($stmt,1);
        if (is_object ($result)) {
            echo $result->load();
            // also tried : echo $result->read($result->size());

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
Reply With Quote
  #2 (permalink)  
Old August 5th, 2004, 08:05 AM
Authorized User
Join Date: Aug 2003
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts

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".
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 10:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.