Re: Foreign keys - No action - Errors

2005-05-23 Thread Frank Schröder

My understanding is that RESTRICT and NO ACTION share the same behavior.

http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html

   *

 |NO ACTION|: In |ANSI SQL-92| standard, |NO ACTION| means /no
 action/ in the sense that an attempt to delete or update a primary
 key value will not be allowed to proceed if there is a related
 foreign key value in the referenced table (Gruber, Mastering SQL,
 2000:181). Starting from 4.0.18 |InnoDB| rejects the delete or
 update operation for the parent table.

   *

 |RESTRICT|: Rejects the delete or update operation for the parent
 table. |NO ACTION| and |RESTRICT| are the same as omitting the |ON
 DELETE| or |ON UPDATE| clause. (Some database systems have
 deferred checks, and |NO ACTION| is a deferred check. In MySQL,
 foreign key constraints are checked immediately, so |NO ACTION|
 and |RESTRICT| are the same.)

This works only on InnoDB tables as - AFAIK - the InnoDB engine the only 
engine is which implements FK constraints.


on 05/24/2005 07:46 AM Sven Åke Johansson said the following:




I have some problem with Foreign Key settings. I use MySQL 4.12, MySQL Query Browser 4.16 and Windows XP. Restrict and Cascade is Ok but when I try to set No action it wont work. Sometimes there is no error message and it seams that the change is saved. But when I check there is no changes. When an error message shows its nr 1005. 




What is the conditions to set No action. Ok In the manual it says only that "No 
action is taken in the child table when rows are deleted from the parent or values in the 
referenced columns in the parent table are updated."



I read the articles on MySQL , a lot of books and the manual but I cant get any answer. 




Thanks for any answer wich will solve my problem.



Sven Åke Johansson

[EMAIL PROTECTED]  





 



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Foreign keys - No action - Errors

2005-05-23 Thread Sven Åke Johansson
 

I have some problem with Foreign Key settings. I use MySQL 4.12, MySQL Query 
Browser 4.16 and Windows XP. Restrict and Cascade is Ok but when I try to set 
No action it wont work. Sometimes there is no error message and it seams that 
the change is saved. But when I check there is no changes. When an error 
message shows its nr 1005. 

 

What is the conditions to set No action. Ok In the manual it says only that "No 
action is taken in the child table when rows are deleted from the parent or 
values in the referenced columns in the parent table are updated."

 

I read the articles on MySQL , a lot of books and the manual but I cant get any 
answer. 

 

Thanks for any answer wich will solve my problem.

 

Sven Åke Johansson

[EMAIL PROTECTED]