How to handle Sybase table with null value in Python
create table Account(
accountId varchar(12) not null,
rollup_indicator char(1) null
)
when need to insert one row as ('038C08234', null) (roolliup_indicator has null value)
sql= "insert into Account(accountId, rollup_indicator) values(?, ?) "
in Python, when detect a value is None, we can't pass None to the sql statement, and there is no NULL variable, if pass 'NULL' string as rollup_indicator value, the insert will not take effect, since rollup_indicator is char(1), 'NULL' is 4 characters.
I am using sybpydb module and execute with cursor
cur.executor(sql, ('038C08234', 'NULL'))
Anyone has experienced with inserting/updating null value in Python Sybase? Thanks,
Bill