Thread: altering table

altering table

From
"Riza Fahmi"
Date:
How to use alter table to add foreign key more than one field? Thanks for the attention





Best Regards,
Riza Fahmi


Re: altering table

From
Stephan Szabo
Date:
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]