MySQL Forums
Forum List  »  Newbie

Re: Table with joint primary key relating to two tables
Posted by: Roland Bouman
Date: July 15, 2005 03:15AM

Question: why would you want to use ON UPDATE CASCADE when the referenced key is AUTO_INCREMENT?

alter table tbl_subcategory_shop
add constraint fk_shop
foreign key (
`Shop Id`
) references tbl_shop (
`Shop Id`
)
on delete cascade
on update cascade

see the CREATE TABLE syntax.

Options: ReplyQuote


Subject
Written By
Posted
Re: Table with joint primary key relating to two tables
July 15, 2005 03:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.