首页 > 数据库 > Oracle > 正文

Oracle数据库日期型的插入(在PLSQL Developer上测试)

2024-08-29 13:31:40
字体:
来源:转载
供稿:网友
注册会员,创建你的web开发资料库,system/admin:数据库表scott方案下的emp
select * from scott.emp  order by empno
insert into scott.emp (empno,hiredate) values(3,to_date('04-2月-2007','dd-mon-yyyy'))
insert into scott.emp (empno,hiredate) values(4,to_date('2007-1月-1','yyyy-mon-dd'))
insert into scott.emp (empno,hiredate) values(5,to_date('2007-1月-1','yyyy-mon-dd hh-mi-ss'))
insert into scott.emp (empno,hiredate) values(6,to_date('2007-1月-1','yyyy-mon-dd hh:mi:ss'))
insert into scott.emp (empno,hiredate) values(7,to_date('1月-2007-1','mon-yyyy-dd hh:mi:ss'))
insert into scott.emp (empno,hiredate) values(8,to_date('1月200701','monyyyydd hh:mi:ss'))
insert into scott.emp (empno,hiredate) values(9,to_date('20071月01','yyyymondd hh:mi:ss'))
insert into scott.emp (empno,hiredate) values(10,to_date('20071月01','yyyymondd hh-mi-ss'))
insert into scott.emp (empno,hiredate) values(11,to_date('20071月01','yyyymondd hh-mi-ss'))

insert into scott.emp (empno,hiredate) values(12,to_date('20-2月-1981 12:00:00','dd-mon-yyyy hh:mi:ss'))

如果实在不能插入的话,在oracle enterprise manager console上登录后,就能查看到这个表里的一个日期型字段。不过要进行插入的话,还是要把月份进行更改才行。把汉字改成阿拉伯数字。后面的am什么的也要删掉。刚刚接触有什么说错的地方还望大家多多指教!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表