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

Mark Dellon markdelon at gmx.at
Thu Oct 8 16:17:15 EDT 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?

MY CODE:
------------------------------------------------
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" )
f.write(aLobData)
f.close()
------------------------------------------------

Thank you very much for every idea.

Best regards

Mark
-- 
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