CLOB w/DBD::Oracle 
Author Message
 CLOB w/DBD::Oracle

Info first:
Oracle 8.0.5.0.0
DBI 1.00
DBD::Oracle 0.54
All running on Solaris 2.6


The problem:  i try to select out a CLOB column, and get an inconsistent
datatypes error

--------------------------------------------------------------------
This bit of code:
........
58 $sql = "SELECT clob_col FROM the_table WHERE (this_col  = that_val)";

59 $sth = $dbh->prepare($sql);
60 $sth->execute();
........

Yields this error:

DBD::Oracle::st execute failed: ORA-00932: inconsistent datatypes (DBD:
oexfet error) at .//my_prog.pl line 60.
---------------------------------------------------------------------
I can select any other columns out of that table just fine... It's just
whenever I try to select the CLOB column do I get the error.  I was even
able to insert into it fine....

anyway... Any insight as to my error (or otherwise) would be greatly
appreciated!

Brian Pitsch



Fri, 13 Apr 2001 03:00:00 GMT  
 CLOB w/DBD::Oracle

Quote:

>Info first:
>Oracle 8.0.5.0.0
>DBI 1.00
>DBD::Oracle 0.54
>All running on Solaris 2.6


>The problem:  i try to select out a CLOB column, and get an inconsistent
>datatypes error

>--------------------------------------------------------------------
>This bit of code:
>........
>58 $sql = "SELECT clob_col FROM the_table WHERE (this_col  = that_val)";

>59 $sth = $dbh->prepare($sql);
>60 $sth->execute();
>........

>Yields this error:

>DBD::Oracle::st execute failed: ORA-00932: inconsistent datatypes (DBD:
>oexfet error) at .//my_prog.pl line 60.
>---------------------------------------------------------------------
>I can select any other columns out of that table just fine... It's just
>whenever I try to select the CLOB column do I get the error.  I was even
>able to insert into it fine....

>anyway... Any insight as to my error (or otherwise) would be greatly
>appreciated!

>Brian Pitsch

You might want to take a look at:
DBMS_LOB.GETLENGTH and DBMS_LOB.SUBSTR
I found that I had to read a CLOB back in
chunks of ~4K.  just keep track of your chunk
size and offset (location in the byte string)
and it should be fine.  I don't suppose you'd
share your insert code?  I can't figure out how to
load a BLOB from a file.  There is a DBMS_LOB
function called LOADFROMFILE, but it needs a
filename mapped to a BFILE type and I'm not sure
how to do that.  I'm stuck using Win32::ODBC
instead of DBM and I can't find anything about binding
variables in the docs :-(

Anita



Fri, 20 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Inserting CLOB using Oracle::DBD

2. Help with DBI and DBD::Oracle and CLOB's

3. Getting error on Oracle CLOB insert using PERL DBI

4. Slow performance reading CLOB data from Oracle with dbi

5. Getting error on Oracle CLOB insert using PERL DBI

6. Oracle CLOB using DBI

7. DBD::DB2 and CLOB?

8. Returning CLOB-value from procedure call with DBD-Oracle8 on WinNT

9. DBD::Oracle, and Oracle RDB

10. Building DBD::Oracle for Oracle 8

11. Using ORACLE DATE field with DBD-Oracle

12. Q: Can DBD::Oracle be used when Oracle TCP/IP access is disabled

 

 
Powered by phpBB® Forum Software