CREATE TABLE/CONSTRAINT PROBLEM [message #18867] |
Tue, 19 February 2002 05:54 |
Dave Rolfe
Messages: 4 Registered: February 2002
|
Junior Member |
|
|
I am trying to create the Table Offer with the following statement:
create table Offer
(offercode char(3) CONSTRAINT check_offer_start_date
check(NOT EXISTS(select offercode from Offer where offer_date between
add_months(sysdate,-6) and sysdate)),
offer_date date not null,
price number(5,2),
num_sold varchar(5) not null,
primary key (offercode,offer_date),
foreign key (offercode) references offer_details(offercode));
This is giving me the error : ORA-02251: subquery not allowed here
Am i confusing my SQL92 and Oracle SQL here?
If not how can i ALTER a table or CREATE a table using this constraint?
Many Thanks
David Rolfe
|
|
|
|