problem with LOB's and DCOracle2

Daniel dl-notspam-rubin at yahoo.com
Wed Jun 4 22:24:53 EDT 2003


Thanks for the suggestion, but when I tried this query instead, it still
fails with a seg fault:

>>> c.execute("select lobfield from foo")
1
>>> a=c.fetchall()
Segmentation fault


"Scherer, Bill" wrote:

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

--
To reply to me directly, please remove "_NoSpam_" from my email address






More information about the Python-list mailing list