I tried to create a new table (tableB) with a foreign key binding to another table (tableA) and just wondering if I can create all the necessary constraints and indexes with it. My goal would be to have one statement create tablewithout the need for an instruction alter table…after this and no other instruction create index…. Is it possible? Thanks for any hint in advance :)
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)
)
);
source
share