ORA-02270 Error
580861Mar 10 2008 — edited Mar 10 2008I got ORA-02270 Error when tried to add foreign key on a detail table:
CREATE TABLE supplier
( supplier_id numeric(10) not null,
supplier_name varchar2(50) not null,
contact_name varchar2(50) ,
insertedate date not null,
CONSTRAINT supplier_pk PRIMARY KEY (supplier_id, insertedate );
);
CREATE TABLE sub_supplier
( supplier_id numeric(10) not null,
sub_supplier_id numeric(10) not null,
insertedate date not null,
other_details varchar2(10),
CONSTRAINT product_pk (supplier_id , sub_supplier_id, insertedate )
CONSTRAINT fk_supplier FOREIGN KEY (supplier_id)
REFERENCES supplier (supplier_id)
);
insertedate is actual system timestamp. I don't think it can be used as a reference.
Any idea how can I resolve this error?
Thank you.