Oracle:制作一个包含三个Foregin键的组合键 [英] Oracle: Make a composite Key containing three Foregin keys
本文介绍了Oracle:制作一个包含三个Foregin键的组合键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
create table orderline
(
Order_No number(4)constraint orderno_fk references order_detail(Order_No),
Product_Code varchar2(6)约束productcode2_fk引用product(Product_Code),
Product_Size char(1)约束productsize_fk引用product_stock(Product_Size),
Product_Quantity number(4)不为空
约束orderline_comp主键(Order_No,Product_Code,Product_Size)
);
我得到错误(在'Order'之前的左括号下面的星号):
第7行的错误:
pre
ORA-00907:缺少右括号
解决方案在
,
>约束命令行...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
解决方案You need a
,
before theconstraint orderline...
这篇关于Oracle:制作一个包含三个Foregin键的组合键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文