在oracle中插入数据时无效的月份 [英] Not a valid month while inserting data in oracle
本文介绍了在oracle中插入数据时无效的月份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用以下查询将数据插入表中.
I am inserting data into the table with the below query..
INSERT INTO xxcus.xxacl_pn_agrmnt_mst
(mkey, transaction_type, survey_area_7_12, ref_date, status,
mst_date, remarks, tran_type, created_by, creation_date,
last_update_date, last_updated_by, delete_flag
)
VALUES (1, 'AGR', 'khan,', '29-09-2016', 'AGD',
'11/09/2016', 'Test', 'AM', '5681', '29-09-2016 17:10:19',
'29-09-2016 17:10:19', '5681', 'N'
)
但是出现错误
2016年9月29日无效的月份
Not a valid month for 29-09-2016
这是我要插入的代码
xw.WriteElementString("REF_DATE", txtRefdate.Value);
我不知道这是怎么回事
推荐答案
您应该通过以下方式强制转换日期列的数据类型
you should cast datatype of your date columns by
to_date('29-09-2016 17:10:19', 'DD-MM-YYYY HH24:MI:SS')
这篇关于在oracle中插入数据时无效的月份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文