How to use DCOracle and LOBs in Oracle 8i ????

Andreas Jung ajung at sz-sb.de
Fri Apr 28 12:48:08 CEST 2000


After reading old postings concerning DCOracle and LOBs I
can not solve the following problem:

I have  a table under Oracle 8i with a NCLOB field. The base
character set for the complete database it UTF8. My first
problem with DCOracle was an ORA-12704 character set mismatch error when
I tried to insert an instance of DCOracle.dbi.dbiRaw() in to the database.


My current code looks like this (the table contains the NCLOB field 'content'):


lob = 'very long text .....'
raw = DCOracle.dbi.dbiRaw(lob)

com = 'insert into tab (docnum,content) values(:x,translate(:y using nchar_cs))'
curs.execute(com,x='1234',y=raw)


This works for LOBs with less than 4000 bytes. For longer LOBs I get the following error
message: ORA-01461 can bind a LONG value only for insert into a LONG column.

Now...how can I store larger LOBs with more than 4000 bytes ? I have read something
about a dbms_lob package but I have really no idea how to use it. 

Has anyone a working solution or a code example ?!


Thanks a lot for any hint,
Andreas 






More information about the Python-list mailing list