複合キー (column1,column2,column3) を持つ Table1 を作成しました
CONSTRAINT table_PK PRIMARY KEY (column1,column2,column3)
テーブル 2 には複合キー (column1,column4) があります
CONSTRAINT table2_FK FOREIGN KEY (column1)
REFERENCES table1 (column1)
CONSTRAINT table2_column4_FK FOREIGN KEY (column4)
REFERENCES table3 (column4)
ただし、テーブル 2 をテーブル 1 に結合することはできません。2 つのテーブル間で、唯一の参照列は column1 のみである必要があります
ただし、次のエラーが表示されます。
SQL Error: ORA-02270: no matching unique or primary key for this column-list
02270. 00000 - "no matching unique or primary key for this column-list"
*Cause: A REFERENCES clause in a CREATE/ALTER TABLE statement
gives a column-list for which there is no matching unique or primary
key constraint in the referenced table.
*Action: Find the correct column names using the ALL_CONS_COLUMNS
catalog view
制約を確認しようとしましたが、すべてが正しいようです。
インターフェイスを使用してテーブルを作成しようとしたところ、うまくいきませんでした。
The number of FK columns (2) does not equal to the number of referenced columns (3)
私が見たところ、別のテーブルを参照するには、同じ量の列が必要です。ただし、必要ではないと思います。必要なのは1列だけですか?私が間違っている場合は、私を修正してください。