CLOB->load() error (OCI8 against Oracle 10G )
CLOB->load() error (OCI8 against Oracle 10G )
am 09.11.2005 16:02:52 von script this
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.=20
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 =3D $row["EXCEPTIONS"]->load())) {
$exceptions =3D print_r($row["EXCEPTIONS"],1);
error_log($row["QUESTION_ID"] .
": " .
$exceptions);
}
} else {
$ans =3D $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] =3D> 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 =09enabled
Revision =09$Revision: 1.183.2.16 $
Oracle Version =0910.1
Compile-time ORACLE_HOME =09/oracle/product/10G
Libraries Used =09no 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 --
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: CLOB->load() error (OCI8 against Oracle 10G )
am 10.11.2005 00:04:27 von Christopher Jones
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 --
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: CLOB->load() error (OCI8 against Oracle 10G )
am 10.11.2005 16:21:48 von script this
.....ok....so as i put together a small testcase of this problem using
the same table and all of the same code except the code between while
(ocifetchinto()) { and } , the testcase worked. looks like we have a
problem with a shallow copy of the clob occurring somewhere in our
database class in the application. it's odd to me that this happens
to clobs and not blobs. given that the exact same block of code runs
against blobs, clobs, and all other values returned from ocifetchinto
call.....
at any rate, thank you for your time etc.
On 11/9/05, Christopher Jones wrote:
> 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:
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php