SQL> alter table teaching
2 add constraint pk_tea_no primary key(t_no,course_no);
表已更改。
SQL> alter table teaching
2 add constraint fk_tea_no foreign key (t_no) references teaalter table teaching
3 add constraint fk_course_no foreign key (course_no) references course(course_no);cher(t_no) on delete cascade;
add constraint fk_tea_no foreign key (t_no) references teaalter table teaching
*
第 2 行出現錯誤:
ORA-01735: 無效的 ALTER TABLE 選項
各位在神幫忙看看是那里錯了?
本人小白一個,在網上找了一個初學者專案(下面是網址),想練習,到這里就出錯了。
https://blog.csdn.net/anhldd/article/details/8296549
uj5u.com熱心網友回復:
你的陳述句里是不是有一個換行,把換行去掉試試看。uj5u.com熱心網友回復:
2 add constraint fk_tea_no foreign key (t_no) references teaalter table teaching3 add constraint fk_course_no foreign key (course_no) references course(course_no)
很明顯,這兩行的語法是不一樣的。 2 錯,3對。
uj5u.com熱心網友回復:
那怎么把2改成正確的?
uj5u.com熱心網友回復:
teaching.t_no 參考誰 ?轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/31354.html
標籤:基礎和管理
