Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-07 17:01:50
Original
1012 people have browsed it

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template