Oracle: Make a composite Key containing three Foregin keys

余生长醉 提交于 2019-12-11 13:54:44

问题


This is my code:

create table orderline
(
Order_No number(4) constraint orderno_fk references order_detail(Order_No),
Product_Code varchar2(6) constraint productcode2_fk references product(Product_Code),
Product_Size char(1) constraint productsize_fk references product_stock(Product_Size),
Product_Quantity number(4) not null
constraint orderline_comp primary key (Order_No,Product_Code, Product_Size)
);

I get the error (with the star underneath the left parenthesis before 'Order'):

ERROR at line 7:
ORA-00907: missing right parenthesis

回答1:


You need a , before the constraint orderline...



来源:https://stackoverflow.com/questions/13767691/oracle-make-a-composite-key-containing-three-foregin-keys

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!