Redian新闻
>
help! A bug about date type !
avatar
help! A bug about date type !# Database - 数据库
d*i
1
Do not why is not work?
maybe date type is wrong.
literal does not match format string
drop table employee;
create table employee( FNAME varchar(15),
MINIT char,
LNAME varchar(15),
SSN char(9),
BDATE date,
ADDRESS varchar(30),
SEX char,
SALARY decimal(10,2),
SUPERSSN char(9),
DNO int
);
insert into employee values('john','B','Smith','123456789',
'1956-11-11',
'731 Fondren, Houston,TX', 'M',
30000,'333445555',5);
avatar
a*c
2
You use a string not date when inserting values into table.
There might be two ways to convert a character string to an
Oracle date.
1. Use TO_DATE('1956-11-11', 'YYYY-MM-DD')
2. Use TO_DATE('11-NOV-56') with default format 'DD-MON-YY'
The syntax is
TO_DATE(string,'format')

【在 d****i 的大作中提到】
: Do not why is not work?
: maybe date type is wrong.
: literal does not match format string
: drop table employee;
: create table employee( FNAME varchar(15),
: MINIT char,
: LNAME varchar(15),
: SSN char(9),
: BDATE date,
: ADDRESS varchar(30),

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。