problem with LOB's and DCOracle2

Scherer, Bill Bill.Scherer at verizonwireless.com
Wed Jun 4 15:51:13 EDT 2003


[P&M]

On Wed, 4 Jun 2003, Daniel wrote:

> I'm trying to create a new LOB to insert into a table, but get an error
> when I try to read it back in (in fact, it's a very bad error--a seg
> fault). I'm using DCOracle2 1.3b Any suggestions?
> 
> >>> db=DCOracle2.connect('me/pw at db')
> >>> clob=db.LobLocator('SQLT_CLOB')
> >>> d='insert into foo values(9, XMLTYPE.createXML(:m))'
> >>> clob.write('<f>foo</f>')
> 10
> >>> db.execute(d, clob)
> 4
> >>> c=db.cursor()
> >>> c.execute("select * from foo")
> 1
> >>> a=c.fetchall()
> Segmentation fault

IIRC, you may only get a clob with a specifc select and a 
fetchone, eg:

  c.execute("select lobFiled from foo")
  a = c.fetchone()

if you want to update that field, do instead:

  c.execute("select lobFiled from foo for update")

HTH - 

-- 
Bill.Scherer at Verizon Wireless
RHCE 807101044903581






More information about the Python-list mailing list