[Baypiggies] Reading file and inserting BLOB in oracle database.

Chris Clark Chris.Clark at ingres.com
Wed Jul 26 20:03:26 CEST 2006

Prasanna Rajagopal wrote:
> Hi
> Thank you for your reply.  Is there something similar to "ingresdbi" for
> Oracle database, in other words, which python oracle driver I should
> use?

I have no idea, I've seen at least one Oracle specific driver in my 
travels but don't recall the name. I suspect google is your best friend 
for that.

There are a couple of ODBC based ones, one with a dual license (mxODBC) 
and there is a free (MIT license) one called PyODBC 
http://pyodbc.sourceforge.net/, I know they have lob support as we've 
had some discussions with them.

One slightly odd option would be to use the ingresdbi driver against 
Oracle :-S ingresdbi is based on ODBC (written in C), it probably won't 
work out of the box but it wouldn't take much work to get it to work 
with multiple back ends (we accept code contributions :-)).

>   I tried ADODB for python, but I felt it does not offer much
> support for BLOB handling.  I am new to Python, so I might be wrong.  

I've never used it (I've heard good things) and I don't know about the 
lob support it has.

> I tried the following:
> ..... snip'ed 
> sql = "insert into blob_test (blobtestid, blob_field) values
> (101,empty_blob())"
> oraCur = oraConn.Execute(sql)
> oraConn.UpdateBlob('BLOB_TEST','BLOB_FIELD', data, 'BLOBTESTID = 101')
> This does not work.
This isn't following the DBI spec (it is an extension) so whilst can 
guess what it is doing I don't _know_ what this is doing, the method 
name certainly does imply there is lob support. You may want to try 
emailing the author of the driver you are using, or even google for the 
method name.

Good luck,


More information about the Baypiggies mailing list