ORA-01722: 临近日期时出现无效数字错误
我试图在 Oracle 表中执行此插入语句,但收到无效数字
错误。甲骨文指出日期是问题所在。但我没有看到问题所在。
INSERT INTO DROPPER_VACATIONS
VALUES (21111,
to_char('2012-01-01','YYYY-MM-DD'),
to_char('2012-01-01','YYYY-MM-DD'),
to_char(sysdate,'YYYY-MM-DD'),
'CRONUSER',
to_char(sysdate,'YYYY-MM-DD HH:MI:SS AM'),
'CRONUSER',
NULL)
I am trying to execute this insert statement into an oracle table but am getting an invalid number
error. Oracle is pointing at the date as the issue. But I dont see the problem.
INSERT INTO DROPPER_VACATIONS
VALUES (21111,
to_char('2012-01-01','YYYY-MM-DD'),
to_char('2012-01-01','YYYY-MM-DD'),
to_char(sysdate,'YYYY-MM-DD'),
'CRONUSER',
to_char(sysdate,'YYYY-MM-DD HH:MI:SS AM'),
'CRONUSER',
NULL)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些不是日期,而是字符。您需要 to_date 将它们转换为日期,但这很愚蠢,因为您显然需要它们作为字符。
或者您打算使用
to_date
将它们转换为日期?这是明智的,因为最好将日期存储为实际日期而不是字符。Those are not dates, but chars. You would need to_date to convert them to dates, but that would be silly, since you apparently need them as chars anyway.
Or did you mean to use
to_date
to convert them to dates? That would be wise, since it is better to store dates as actual dates rather than chars.