[DB-SIG] DCOracle / BLOB

Greg Stein gstein@lyra.org
Thu, 15 Jul 1999 11:19:43 -0700


Jim Fulton wrote:
> 
> Sebastian Schneckener wrote:
> >
> > Hello everybody
> >
> > I am trying to store images as BLOB in an oracle database using the DCOracle interface.
> > I found out, that if I use a statement like:
> >
> > cursor.execute ("INSERT INTO  images values (1,1,1,'X',:p1)",(image,))
> >
> > the image has to be in a hex format.
> > So far, so easy, but if the image is larger than 4000 byte, I get a problem:
> >
> >   File "/software/pub_gen/lib/python1.5/site-packages/DCOracle/ociCurs.py", line 225, in execute
> >     if rc!=3129: self._error()
> >   File "/software/pub_gen/lib/python1.5/site-packages/DCOracle/ociCurs.py", line 81, in _error
> >     raise error, (rc, oci_.OracleErrorMessage(self._c.lda, rc))
> > oci.error: (1461, 'ORA-01461: can bind a LONG value only for insert into a LONG column\012')
> >
> > Neither I realy understand this nor I know a workaround. The column type in images is BLOB of course.
> > Anybody any ideas?
> 
> You can't really insert BLOBS using SQL in Oracle. (Well, you can insert short
> Blobs with SQL, but you cant update the values with SQL.) You have to create
> blob objects. :(
> 
> >From the documentation for the 1.2.1 release:
> 
>     Oracle 8 Large Objects (LOBs)
> 
>       Limited support is provided for Oracle 8 large objects (LOBs).
>       To get LOB support, you must link against Oracle 8 client
>       libraries and make sure that the -DDCORACLE8 switch is supplied
>       when the oci_ extension module is built.

Euh... what happened to being able to use dbi.dbiRaw() to wrap a string
and insert it that way?

I used to insert LONG objects all the time this way, even really large
ones. Are BLOBs a different beast?

Cheers,
-g

--
Greg Stein, http://www.lyra.org/