4
我試圖創建一個新的表(tableB)與外鍵約束到另一個表(tableA),只是想知道我是否可以與此一起創建所需的所有約束和索引。我的目標是有一個create table
聲明,事後不需要alter table…
聲明,也沒有其他create index…
聲明。這可能嗎?感謝提前任何提示:)如何在一個create table語句中使用Index創建外鍵? (甲骨文)
create table tableA
(
id number
, constraint tableApk primary key (id)
);
create table tableB
(
id number
, constraint tableBfk foreign key (id) references tableA (id)
on delete cascade
using index (
create index tableBfkidx on tableB (id)
)
);
這完全是關於'tableB',而不是'tableA' ......並且對於主鍵我可以使用'使用索引(...)' - 只是想知道爲什麼這對外鍵是不可能的。 – Ben