MySQL Forums
Forum List  »  InnoDB

Re: Foreign Keys Dont Work
Posted by: Radu Chiriac
Date: January 12, 2005 01:49AM

hmm... indeed, might not work with your version of mysql - worked for me (the queries i posted) on mysql4.1.8

btw, as i mentioned,

CREATE TABLE `master` (
...
`Dept_ID` int(11) NOT NULL default '0',
CONSTRAINT 'admission_dept' FOREIGN KEY (Dept_ID) REFERENCES dept1(Dept_ID) ON DELETE SET NULL

the above 2 conditions are contradictory - i was getting an error because of them. U should either change the ON DELETE option or allow nulls for dept_id

best regards,
Radu

Options: ReplyQuote


Subject
Views
Written By
Posted
4063
January 06, 2005 11:34PM
2513
January 07, 2005 03:58PM
Re: Foreign Keys Dont Work
2556
January 12, 2005 01:49AM
2436
January 09, 2005 07:15PM
2476
January 10, 2005 05:02PM
2418
January 12, 2005 05:37PM


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.