Re: [cx-oracle-users] Inserting BLOBs with cx_Oracle 3.0
Brought to you by:
atuining
From: Anthony T. <an...@co...> - 2004-04-27 21:44:28
|
Yes, you can. You need to use the constants LONG_STRING or LONG_BINARY instead of CLOB and BLOB or STRING and BINARY. The only real advantage to using CLOB and BLOB is that an empty_blob() can actually be passed; otherwise, Oracle will silent convert an empty string to a NULL value. :-) Hope that helps. On Tue, 2004-04-27 at 15:26, Jeff Wong wrote: > Hi, > > Is it possible to insert BLOBs using cx_Oracle 3.0? I have been able > to do it like this using cx_Oracle 4.0: > > v = cursor.var( cx_Oracle.BLOB, len( stuff )) > v.setvalue( 0, stuff ) > cursor.execute( "insert into blob_test values ( :blob ) ", {'blob', v } ) > > You can't do this in cx_Oracle 3.0 because the BLOB constant is not > defined. Using the BINARY constant doesn't work because I will get > complaints from setvalue about the string data being too large. (I am > inserting BLOBS of > greater than 4000 bytes.) > > I understand that I could upgrade but I'd like to avoid doing that if > possible. > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users -- Anthony Tuininga an...@co... Computronix Distinctive Software. Real People. Suite 200, 10216 - 124 Street NW Edmonton, AB, Canada T5N 4A3 Phone: (780) 454-3700 Fax: (780) 454-3838 http://www.computronix.com |