Re: CLOB->load() error (OCI8 against Oracle 10G )

From: Date: Wed, 09 Nov 2005 23:04:27 +0000
Subject: Re: CLOB->load() error (OCI8 against Oracle 10G )
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-40635@lists.php.net to get a copy of this message
What line of code is 1546? How are you binding/executing/fetching? Are you using OCI_B_CLOB? If you post a complete (small) testcase we may can look at it. Please include DDL to create any table. Most importantly, use the refactored OCI8 driver: http://pecl.php.net/package/oci8 -- cj Script This wrote:
I have an OCI-Lob Object (in this case a clob) on which I am calling load(). I have identical code for a blob that works perfectly fine. I can't find any documentation or notes about this function or my error... Code that produces error:
     // i get here after succesfully executing
     // a select statement and getting back results
     if (is_object($row["EXCEPTIONS"])) {
        // this call to load gives php warning below
        if (!($ans = $row["EXCEPTIONS"]->load())) {
          $exceptions = print_r($row["EXCEPTIONS"],1);
          error_log($row["QUESTION_ID"] .
                    ":  " .
                    $exceptions);
        }
      } else {
        $ans = $row["EXCEPTIONS"];
      }
PHP Error: [07-Nov-2005 13:23:58] PHP Warning: load(): OCILobGetLength: OCI_INVALID_HANDLE in file.php on line 1546 Output from print_r($row["EXCEPTIONS"]) [07-Nov-2005 13:23:58] OCI-Lob Object (
    [descriptor] => Resource id #51
) Is this a bug? I can't find any documentation or messages in the archives that have helpful information. Here are some details about my environment: PHP Version 4.3.10 System Info: Linux my.server.com 2.4.9-e.27smp #1 SMP Tue Aug 5 15:49:54 EDT 2003 i686 OCI information: OCI8 Support enabled Revision $Revision: 1.183.2.16 $ Oracle Version 10.1 Compile-time ORACLE_HOME /oracle/product/10G Libraries Used no value If I add +OCI_RETURN_LOBS to my call to OCIFetchInto, I get all the right data back without having to call load, however, this will effectively break a LOT of code that deals with BLOBS. I will probably end up using this as a temporary fix in some manner that won't break the rest of the application. However, I would be very grateful to anyone who has a better solution...like how to get the load function to work on a CLOB that is most definitely already an OCI-Lob object? Thanks in advance --


« previous php.db (#40635) next »