[Zope-dev] ZOracle LOB Questions

Alexander Schad ags@beehive.de
Mon, 31 Jul 2000 14:42:40 +0200 (CEST)


Hello!

i have Oracle 8.1.6 ZOracleDA 2.2 installed with Zope 2.1.6 on a red hat
linux machine.

i have an oracle table with one column containing blobs. Now i have
the following problems:

1. How can i retrieve data from that table in zope or in python (syntax) ?

2. How can i insert data to that table ?
   i need the zope syntax something like:
	insert into blob_table values ('<dtml-var image>') ???
   or the python syntax 

i have written a little script:

import DCOracle, sys, os, DCOracle.dbi

dbc = DCOracle.Connect('mozdb_dba/mozdb_dba')
cur = dbc.cursor()
fn = open('test_img.jpg','rb')
data = fn.read()
fn.close()
param = DCOracle.dbi.dbiRaw(data)
cur.execute('select blobcol from blobtable')
dat = cur.fetchone()
cur.close()
dbc.close()
print dat

when i try to execute it i get the following error:

Traceback (innermost last):
  File "blobtest.py", line 12, in ?
    dat = cur.fetchone()
  File "DCOracle/ociCurs.py", line 339, in fetchone
    self._error()
  File "DCOracle/ociCurs.py", line 109, in _error
    raise error, (rc, oci_.OracleErrorMessage(self._c.lda, rc))
oci.error: (24813, 'ORA-24813: cannot send or receive an unsupported
LOB\012')

3. Is there a way to call a stored procedure or function that actually
   return values ? 
   i succeeded in retrieving one particular value out of a table but when
   i try a function like :
        select * from some_table
   i fail...


4. Changes.txt:

  Z Oracle DA Releases

  2.2.0

    Added a small feature that allows you to access LOBs in the Oracle 
    database.  To do this, you must have your maximum number of
    results set to '1'.  Otherwise, it won't work.

  i don't know what this is referring to. where should i make this change?

Ciao,
	Alex


--------------------------------------------------------------------------
 Alexander G. Schad (Programmer)    beehive elektronische medien gmbh
--------------------------------------------------------------------------
 mailto:ags@beehive.de              mailto:service@beehive.de
                                    http://www.beehive.de
                                    fon: (+49 30) 84 78 20
                                    fax: (+49 30) 84 78 22 99