MySQL Forums
Forum List  »  InnoDB

ON DELETE SET CUSTOM VALUE
Posted by: Juhani Hakala
Date: March 14, 2008 07:09AM

I have a problem, but I don't know how to set it right or is it even possible.

I have tables companies and users. And I have saved in companies table a one almost empty record for users who doesn't belong to any company, lets say this empty record's companyID is 1.

Problem is when I delete a company record on delete it should change all the users who had the deleted company id, changes it to this empty record.

ON DELETE SET NULL / Default works, but how I can set it to number 1?

ON DELETE SET 1 gives an error. Is this even possible?

Sincerely,
Juhani Hakala

Options: ReplyQuote


Subject
Views
Written By
Posted
ON DELETE SET CUSTOM VALUE
4326
March 14, 2008 07:09AM


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.