create sequence num
start with 1
increment by 1
nomaxvalue
nocycle
create table OneCard
(
id number not null,
createdate date,
value varchar(50)
)
insert into OneCard(id,createdate,value) values(num.nextval,to_date('2012-10-23 8:00:00'),'30')
insert的语法哪儿错了 ? 插不进去
是不是createdate列的错误?
改成
insert into OneCard(id,createdate,value)
values(num.nextval,to_date('2012-10-23 8:00:00','yyyy-mm-dd hh24:mi:ss'),'30');
你查询一下这两条SQL 你就明白了...[code=SELECT] to_date('2012-10-23 8:00:00') FROM dual;
SELECT to_date('2012-10-23 8:00:00','yyyy-mm-dd hh24:mi:ss') FROM dual;
[/code]
to_date('2012/10/23 8:00:00' yyyy/mm/dd hh24:mi:ss')
to_char(sysdate,'yyyy-mm-dd')