4
使用pyodbc,如果我尝试并执行日期字段验证码:在pyodbc绑定一个空值日期字段
cursor.execute('insert into test VALUES (?)', None)
...我得到pyodbc.Error: ('HY000', '[HY000] [SAS][SAS ODBC Driver][SAS Server]ERROR: Value 1 of VALUES clause 1 does not match the data type of the corresponding column in (-1) (SQLExecDirectW)')
,而如果我执行此:
cursor.execute('insert into test VALUES (null)')
...它的工作原理。是否有另一种方式来执行这个,这意味着我不需要检查我传递的参数?