Обсуждение: altering table

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

altering table

От
"Riza Fahmi"
Дата:
How to use alter table to add foreign key more than one field? Thanks for the attention





Best Regards,
Riza Fahmi


Re: altering table

От
Stephan Szabo
Дата:
On Wed, 9 Apr 2003, Riza Fahmi wrote:

> How to use alter table to add foreign key more than one field? Thanks
> for the attention

If you mean a multi-column foreign key:

alter table foo add constraint name foreign key (col1, col2, col3)
references bar(pcol1, pcol2,pcol3);

[The columns on bar are unnecessary if you're referencing the primary key]