[cx-oracle-users] Null value converts to python None and when used for update converts to string 'N
Brought to you by:
atuining
From: Anurag C. <anu...@gm...> - 2013-04-02 02:52:17
|
*Dear friends...Could you please help me with this issue?* *Steps to reproduce?* 1. Fetch the value of a varchar2 column that has Null as its current value. 2. Use the fetched value to update any table's column. *Expected output?* Instead of updating to Null, the table column gets updated to a string value of 'None' *Version in use* Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32 cx_Oracle - 5.1.2 Oracle 11G *Additional information* This could be because in the update query, I am using '%s' format....for example cursor.execute("UPDATE EMP SET NAME='%s'" %(None)) But there is no other way. If i simply use cursor.execute("UPDATE EMP SET NAME=%s" %(None)) then I get a syntax error. There should be a way to update a column to NULL Regards, Guddu |