2つの多対多表の間にあるOracleでリレーション/表を作成しようとしているため、この表の主キーは複合キーですが、両方のキーは外部キーです。複合外部キー - Oracleでは可能ですか?
CREATE TABLE employee_licence_certificate(
emp_id NUMBER(4) REFERENCES employee(emp_id)
, licence_cert_code VARCHAR2(6) REFERENCES licence_certificate(licence_cert_code)
, date_earned DATE NOT NULL
)
PRIMARY KEY (emp_id, licence_cert_code))
私は、組成キーの方法を使用して試してみましたが、私は不思議が、このことも可能である私を作るために開始され、次のエラーを、得るように見えますか?
Error starting at line 1 in command:
CREATE TABLE employee_licence_certificate(emp_id NUMBER(4) REFERENCES employee(emp_id)
, licence_cert_code VARCHAR2(6) REFERENCES licence_certificate(licence_cert_code)
, date_earned DATE NOT NULL) PRIMARY KEY (emp_id, licence_cert_code))
Error at Command Line:3 Column:29
Error report:
SQL Error: ORA-00922: missing or invalid option
00922. 00000 - "missing or invalid option"
*Cause:
*Action:
[SQLエラー:ORA-00922:複合キーを作成するオプションがありません](http://stackoverflow.com/questions/8426047/sql-error -ora-00922-missing-or-invalid-option-creating-composite-key) –
はいごめんなさい昨日の夜/午前に私は徹夜で働いて忘れていたことを忘れていました。私を許して。 @JustinCave –