Issue 316: Null value converts to python None and when used for update converts to string 'None'
Status:  New
Owner: ----
Reported by anurag.c...@gmail.com, Apr 1, 2013
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
Apr 30, 2013
#1 jtas...@gmail.com
Use parameters instead:
  cursor.execute("UPDATE EMP SET NAME=?", (None, ))
Nov 24, 2014
#2 david.tz...@gmail.com
I'm using pyodbc to query Teradata database from a Linux machine.

I'm having some other issues when selecting a column with NULL values. 
If an integer is the next selected columns, it corrupts the data and returns some garbage value. 

I think it only happens when the NULL column is of type Date.

Any idea what should cause this issue and how to fix it?