对于表中的时间类型,当为空时,直接插入空字符串时会报错提示时间格式不正确,在SQL语句里能插入NULL值,我在C里面用SQLBindParameter该怎样绑定NULL值,写到时间类型的字段里?
SQL="INSERT CTEST (CLT_TIME) VALUES(?)"
parameter="2008-11-06 14:45:33.000000";
cliRC = SQLBindParameter(hstmt,
i,
SQL_PARAM_INPUT,
SQL_C_CHAR,
SQL_CHAR,
26,
0,
parameter,
0,
NULL);
当时间有值时,是可以插入的,当为空时,就不能插入,提示An invalid datetime format was detected; that is, an invalid string representation or value was specified. SQLSTATE=22007
我该怎么做?
谢谢
------解决方案--------------------------------------------------------
Just Try:
------------------------
cliRC = SQLBindParameter(hstmt,
i,