插入查询引发日期问题 [英] Insert query throws date problem

查看:80
本文介绍了插入查询引发日期问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在oracle中执行以下插入操作,这给了我日期错误..

 ORA-01830:日期格式图片在转换整个输入字符串 <之前就结束了/pre> 



insert into VISITOR_REG ( VISITOR_NAME,MOBILE_NO,COMPANY,PURPOSE,BRANCH_ID,DEPARTMENT,CONTACT_PERSON,CITY,VISIT_DATE,ENTRY_PERSON,EXIT_PERSON,STATUS,LUGGAGE ) values (''Darshin'',9987854533,''web development'',''website development'',''B0001'',''C10001'',''E00001'',''Ahmedabad'',''04-MAY-11 10:09:59 PM'','''','''',''Pending'',''Laptop'')



帮助任何人都知道解决方案...

解决方案

在此处输入日期时,请考虑使用to_date函数.这会将此处代码的日期部分更改为

 to_date('  04-MAY- 11 10:09:59 PM''  DD-MON-YY HH:MI:SS PM' )


您的NLS_DATE_FORMAT与您的日期字符串不匹配.您需要更改NLS_DATE_FORMAT,或使用to_date函数:
http://www.techonthenet.com/oracle/functions/to_date.php [ ^ ]


Hi guys,

I am performing following insert operation in oracle which gives me date error..

ORA-01830: date format picture ends before converting entire input string





insert into VISITOR_REG ( VISITOR_NAME,MOBILE_NO,COMPANY,PURPOSE,BRANCH_ID,DEPARTMENT,CONTACT_PERSON,CITY,VISIT_DATE,ENTRY_PERSON,EXIT_PERSON,STATUS,LUGGAGE ) values (''Darshin'',9987854533,''web development'',''website development'',''B0001'',''C10001'',''E00001'',''Ahmedabad'',''04-MAY-11 10:09:59 PM'','''','''',''Pending'',''Laptop'')



help if anybody knows the solution...

解决方案

As you are entering a date here, consider using the to_date function. This would change the date portion of your code here to

to_date('04-MAY-11 10:09:59 PM', 'DD-MON-YY HH:MI:SS PM')


Your NLS_DATE_FORMAT does not match your date string. you need to alter NLS_DATE_FORMAT, or use the to_date function:
http://www.techonthenet.com/oracle/functions/to_date.php[^]


这篇关于插入查询引发日期问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆