extract oracle-BLOBs to the file system ( some docs not readable

Mark Dellon markdelon at gmx.at
Thu Oct 8 22:17:15 CEST 2009

Dear colleges,

I read BLOBs from oracle database and write these in a loop to a the file system. 
Some documents (e.g.PDF) are not correct and I can't open these.

Database size of these blobs is different to size on the file system.

Which code I should use for readig blob from oracle database?
Need I to use chunks?
Where is the problem please?

sys.dbc = cx_Oracle.connect("user/password at db")

sys.csr.execute('SELECT blob FROM BLOB_TABLE')
aSQLData = sys.csr.fetchone()
aLob     = aSQLData[0]
aLobData = aLob.read() #this is type str 

f = open ("c:\\tmp\\test.pdf","wb" )

Thank you very much for every idea.

Best regards

GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

More information about the Python-list mailing list