Home  >  Article  >  Database  >  jdbc向Oracle数据库插入系统时间

jdbc向Oracle数据库插入系统时间

WBOY
WBOYOriginal
2016-06-07 17:01:501013browse

Oracle中与sqlserver 插入日期型数据时,有比较大的区别。sqlserver中,直接把日期型数据用单引号括起来就可以,而Oracle却必须用

Oracle中与sqlserver 插入日期型数据时,有比较大的区别。sqlserver中,直接把日期型数据用单引号括起来就可以,而Oracle却必须用to_date('',''')这种强类型转换函数显示转换为Date类型。例子:

insert into employee(id,name,dates) values(4,'wang',to_date('01-4月-2001','dd-Mon-yyyy'))

insert into employee(id,name,dates) values(5,'wang',to_date('01-04-2001','dd-mm-yyyy'))

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn