SQL> create table sales_order(
2 ono varchar2(6) check(ono like 'o%'),
3 cno varchar2(6),
4 orderdate date not null,
5 deladder varchar2(30),
6 sno varchar2(6), deltype char(1) check (deltype in('P','F')),
7 bill char(1),
8 delydate date CHECK(delydate in('delydate>orderdate')),
9 orderstatus varchar2(10) check(orderstatus in('inprocess','fullfilled','
backorder',
10 'cancelled')),
11 constraint p5 primary key(ono),
12 constraint f3 foreign key(sno) references salesman_master(sno)
13 );
create table sales_order(
*
ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expected
答案 0 :(得分:1)
您的delydate
无效check
。它会检查varchar
而不是date
。
试试这个:
create table ...
add constraint delydate_c CHECK(delydate > orderdate)