[cx-oracle-users] Streaming to and from BLOBs?
Brought to you by:
atuining
From: Bradley L. <bra...@ra...> - 2006-02-06 18:42:03
|
Hi folks. I'm having a problem with inserting some particularly large files in a BLOB field. The particular file in question is 1.5GB though there are others which are similar in size. (I believe it is an awful idea to have these files in the database, but it is unfortunately non-negotiable at this point) An example snippet of my file-to-blob glue code is as follows: ... f = file('gigantic.bin','rb') cur = db.cursor() sql = """INSERT INTO BLOBTABLE (BIGFILE) VALUES (:1)""" cur.execute(sql, f.read()) ... Basically I'm reading the whole file into memory before passing it into the cursor, which naturally causes an out of memory exception. Does cx_Oracle have any way of dealing with this problem? What's a better way of inserting this file into the database? -- Bradley Lawrence Application Developer, RapiData Rapid Technology Corporation (403) 209-3000 ext. 237 |