What steps will reproduce the problem?
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.
What is the expected output? What do you see instead?
Instead of updating to Null, the table column gets updated to a string value of 'None'
What version of the product are you using? On what operating system?
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
Please provide any additional information below.
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
Use parameters instead: cursor.execute("UPDATE EMP SET NAME=?", (None, ))