使用 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)')
... 有用。有没有另一种方法来执行这个,这意味着我不需要检查我传递的参数?