Oracle:创建一个包含三个外键的复合键

时间:2012-12-07 17:06:36

标签: sql oracle foreign-keys primary-key composite

这是我的代码:

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)
);

我收到错误(在'Order'之前左括号下面有星号):

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

1 个答案:

答案 0 :(得分:0)

,

之前需要constraint orderline...