我需要reg_date
列值自动生成为当前系统日期。
本声明:
CREATE TABLE medina_student (
sno NUMBER(7) NOT NULL,
sname VARCHAR2(20) NOT NULL,
dept VARCHAR2(5) NOT NULL,
reg_date DATE DEFAULT 'sysdate' NOT NULL,
CONSTRAINT sno_pk PRIMARY KEY (sno),
CONSTRAINT sna_u UNIQUE (sname)
);
产生错误
reg_date date default 'sysdate' not null ,
*
ERROR at line 5:
ORA-01858: a non-numeric character was found where a numeric was expected
如何解决?
答案 0 :(得分:3)
错误确实在第5行,删除了'
:
reg_date date default sysdate not null