Обсуждение: Foreign Key Option

Поиск
Список
Период
Сортировка

Foreign Key Option

От
Erwin Ambrosch
Дата:
Hi all,

can I change the foreign key optins (e.g. ON UPDATE, ON DELETE) after the
table has been created. And if yea, does the change also affect already
inserted rows.

Thaks Erwin

Re: Foreign Key Option

От
Stephan Szabo
Дата:
On Mon, 6 May 2002, Erwin Ambrosch wrote:

> can I change the foreign key optins (e.g. ON UPDATE, ON DELETE) after the
> table has been created. And if yea, does the change also affect already
> inserted rows.

You could drop the triggers and then recreate the constraint
with alter table.  That won't affect past changes (for example rows that
were deleted by a on delete cascade wouldn't suddenly become visible with
nulls if it were changed to on delete set null).