Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-02256: number of referencing columns must match referenced columns

3038780Sep 25 2015 — edited Sep 25 2015

The following script gives

ORA-02256: number of referencing columns must match referenced columns, cannot think about any reason, anyone have any idea?

Please help, I'm stuck on an Assignment.... !!!!

Capture.PNG

drop table qualitycheck;

drop table allocation;

drop table manager;

CREATE TABLE MANAGER (

mgrid number (4),

mfirstname varchar2(30),

msurname varchar2(30),

Primary Key (mgrid)

);

CREATE TABLE ALLOCATION (

prodid number (4) CONSTRAINT NN_PRODUCT_prodid NOT NULL,

mgrid number (4) CONSTRAINT NN_MANAGER_mgrid NOT NULL,

Primary Key (prodid,mgrid),

CONSTRAINT FK_ALLOCATION_MANAGER_mgrid Foreign Key (mgrid) REFERENCES MANAGER,

CONSTRAINT FK_ALLOCATION_PRODUCT_prodid Foreign Key (prodid) REFERENCES PRODUCT

);

CREATE TABLE QUALITYCHECK (

prodid number (4) CONSTRAINT NN_ALLOCATION_prodid NOT NULL,

mgrid number (4) CONSTRAINT NN_ALLOCATION_mgrid NOT NULL,

weekno number (2),

score number (1),

Primary Key (prodid,mgrid,weekno),

CONSTRAINT FK_QUALITYCHECK_PRODUCT_prodid Foreign Key (prodid) REFERENCES ALLOCATION,

CONSTRAINT FK_QUALITYCHECK_MANAGER_mgrid Foreign Key (mgrid) REFERENCES ALLOCATION

);

This post has been answered by Ullhas on Sep 25 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2015
Added on Sep 25 2015
4 comments
847 views