在Oracle SQL中创建表时出错

时间:2014-12-07 07:56:59

标签: sql oracle ddl

目前正在使用SQL * Plus:版本11.2.0.4.0生产 任何帮助将不胜感激。

SQL> CREATE TABLE Distributed_Movie_List (
Distribution_ID Number(8) PRIMARY KEY,
Movie_ID Number(5) REFERENCES Movies(Movie_ID),
Distributor_ID Number(3) REFERENCES Movie_Distributors(Distributor_ID), 
Distribute_Type varchar2(10),
Inventory_Quantity Number(3), 
Unit_Price Number(8,2)
);

CREATE TABLE Distributed_Movie_List (Distribution_ID Number(8) PRIMARY KEY, 
Movie_ID Number(5) REFERENCES Movies(Movie_ID),
Distributor_ID Number(3) REFERENCES Movie_Distributors(Distributor_ID), 
Distribute_Type varchar2(10),
Inventory_Quantity Number(3), 
Unit_Price Number(8,2))
                                                                                                                             *
ERROR at line 1:
ORA-00942: table or view does not exist

1 个答案:

答案 0 :(得分:0)

问题在于行Distributor_ID Number(3) REFERENCES Movie_Distributors(Distributor_ID)

根据错误消息中星号的位置,Movie_Distributors不存在(或者用户发出create table语句可能没有权限)。