ผมจะใช้ fk 2 ตัว จากตาราง users แต่ปรากฎว่า เกิด error "no matching unique or primary key for this column-list " ครับ คำสั่งผมผิดหรือไม่ครับผมต้องแก้ที่ไหน ขอคำแนะนำด้วยครับ
constraint repair_user_no_fk foreign key(user_no) references users(user_no), บรรทัดนี้ครับที่แจ้งผิดพลาด
*
create table repair(
repair_no number(5),
user_no number(5) ,
user_no2 number(5) ,
product_no number(4),
status_id varchar2(2),
series varchar2(30) not null,
color varchar2(30) not null,
damage varchar2(100) not null,
photo blob ,
repair_detail varchar2(100),
date_assign date default sysdate,
data_consign date,
status_pay varchar2(30),
constraint repair_repair_no_pk primary key(repair_no),
constraint repair_user_no_fk foreign key(user_no) references users(user_no),
constraint repair_user_no2_fk foreign key(user_no2) references users(user_no),
constraint repair_product_no_fk foreign key(product_no) references product(product_no),
constraint repair_status_id_fk foreign key(status_id) references repstatus(status_id)
)
Oracle error " no matching unique or primary key for this column-list " ขอคำแนะนำด้วยครับ
constraint repair_user_no_fk foreign key(user_no) references users(user_no), บรรทัดนี้ครับที่แจ้งผิดพลาด
*
create table repair(
repair_no number(5),
user_no number(5) ,
user_no2 number(5) ,
product_no number(4),
status_id varchar2(2),
series varchar2(30) not null,
color varchar2(30) not null,
damage varchar2(100) not null,
photo blob ,
repair_detail varchar2(100),
date_assign date default sysdate,
data_consign date,
status_pay varchar2(30),
constraint repair_repair_no_pk primary key(repair_no),
constraint repair_user_no_fk foreign key(user_no) references users(user_no),
constraint repair_user_no2_fk foreign key(user_no2) references users(user_no),
constraint repair_product_no_fk foreign key(product_no) references product(product_no),
constraint repair_status_id_fk foreign key(status_id) references repstatus(status_id)
)