[Zope] DCOracle v1.3.1b blob insertion error

Cheuk Cheng cheuk_c@yahoo.com
Sun, 21 May 2000 14:42:47 -0700 (PDT)


I'm running DCOracle v1.3.1b with Oracle 8.1.6 (8iR2)
on a W2k Server. I created a test table with only a
primary key and a blob column.  Then I tried to insert
some test data into it with the code below:

import DCOracle, sys, os, DCOracle.dbi

dbc = DCOracle.Connect('user/pwd@dbname')
cur = dbc.cursor() 
fn = open('test_img','rb')
data = fn.read()
fn.close()
param = DCOracle.dbi.dbiRaw(data)
cur.execute('insert into image_test (no, img)
values(35, :p1)', param)
dbc.commit()
cur.close()
dbc.close() 

The error occurs whenever 'test_img' is greater than
4000 bytes. Perhaps it has something to do with the
Oracle VARCHAR2 size limit. If 'test_img' is larger
than 4K, I get the following traceback:   

<DCOracle.dbi.dbiRaw instance at 887d60>
Traceback (innermost last):
  File "DCOracle_test.py", line 14, in ?
    cur.execute('insert into image_test (no,img)
values(35,:p1)',param)
  File
"E:\site\lib\python\Products\DCOracle\ociCurs.py",
line 299, in execute
    r = self._execute(params__, kw)
  File
"E:\site\lib\python\Products\DCOracle\ociCurs.py",
line 260, in _execute
    if rc!=3129: self._error()
  File
"E:\site\lib\python\Products\DCOracle\ociCurs.py",
line 109, in _error
    raise error, (rc,
oci_.OracleErrorMessage(self._c.lda, rc))
oci.error: (3113, 'ORA-03113: end-of-file on
communication channel\012')

Did anyone have similar problem? Is it true that
DCOracle treats all data (including blob) as string? 
The 4K limit seems to hint that DCOracle tries to
insert my 'test_img' as varchar.  Any comments?  

-CC

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/