List:General Discussion« Previous MessageNext Message »
From:Lola J. Lee Beno Date:January 2 2009 11:03am
Subject:Re: How to Use Cascade Delete Properly
View as plain text  
Ian Simpson wrote:
> If you want deletes to be blocked, then you shouldn't be using ON DELETE
> CASCADE; the default behaviour is ON DELETE CONSTRAIN, which seems to be
> what you want; it will refuse to delete any rows that are depended on by
> rows in other tables.
>   

Wouldn't that be:

ALTER TABLE `jobsearchtwodb`.`jobposts` ADD CONSTRAINT `adsourcefk` 
FOREIGN KEY `adsourcefk` (`adsource_id`)
    REFERENCES `adsource` (`adsource_id`)
    ON DELETE RESTRICT
    ON UPDATE NO ACTION;


ON DELETE RESTRICT having the behavior like ON DELETE CONSTRAIN?

-- 
Lola J. Lee Beno - ColdFusion Programmer/Web Designer for Hire
http://www.lolajl.net/resume | Blog at http://www.lolajl.net/blog/
"No greater injury can be done to any youth than to let him feel that
because he belongs to this or that race he will be advanced in life 
regardless of his own merits or efforts." - Booker T. Washington

Thread
How to Use Cascade Delete ProperlyLola J. Lee Beno1 Jan
  • Re: How to Use Cascade Delete ProperlyIan Simpson2 Jan
    • Re: How to Use Cascade Delete ProperlyLola J. Lee Beno2 Jan
      • Re: How to Use Cascade Delete ProperlyIan Simpson2 Jan
  • RE: How to Use Cascade Delete ProperlyJerry Schwartz2 Jan
    • RE: How to Use Cascade Delete ProperlyMartin Gainty3 Jan