[DB-SIG] Re: How to use DCOracle and LOBs in Oracle 8i ????

Peter Sabaini sabaini@niil.at
Fri, 28 Apr 2000 18:39:46 +0200 (CEST)


i do it with prepare()

something like:

  --------- py snip --------------

conn=Connect( "%s/%s@%s" % (user,pw,srv) )

# klz_artikel_union's second col is long
h=conn.prepare(
		"""insert into klz_artikel_union values (
		:p1, :p2 )"""
			)
# getFullText() is usually up to 20kbyte
h.execute( (
	oa.getId(),
	oa.getFullText()
		) )

  --------- py snip --------------

works for me.

hth peter.

On Fri, 28 Apr 2000, Andreas Jung wrote:

: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 
:
:
:
:

-- 

_________________________________________________
peter sabaini, mailto: sabaini@niil.at
-------------------------------------------------