Re: on update problem?
It would seem strange to implement one and not the other? The help does say that you can use it and does keep the create options now. Does anyone know if this will be implemented in the next .5x release? Ross Me& writes: > Hi! > > don't think ON UPDATE is supported. > > The manual : http://www.innodb.com/ibman.html doesn't mention anything about > it except : > > Starting from version 3.23.50 you can also associate the ON DELETE CASCADE > or ON DELETE SET NULL clause with the foreign key constraint. > > EG > > >> When I try to change the id field in the parent table below, I get the >> error: 1217 - Cannot delete a parent row; a foreign key constraint fails. >> >> What have I got wrong? Shouldn't it cascade the changes that were made to >> the parent down to the child table? >> >> This is done with Mysql 3.23.50-max on Windows NT >> >> Here is the create that I am using for the test >> >> CREATE TABLE parent(id INT unsigned NOT NULL, PRIMARY KEY (id)) > TYPE=INNODB; >> create table child >> ( >> id int unsigned not null auto_increment >> , parent_id int unsigned not null >> , name varchar(20) null >> , primary key (id) >> , index parent_id(parent_id) >> FOREIGN KEY (parent_id) REFERENCES parent(id) >> ON UPDATE CASCADE >> ) TYPE=INNODB; >> >> >> Thanks in advance >> >> - >> Before posting, please check: >>http://www.mysql.com/manual.php (the manual) >>http://lists.mysql.com/ (the list archive) >> >> To request this thread, e-mail <[EMAIL PROTECTED]> >> To unsubscribe, e-mail > <[EMAIL PROTECTED]> >> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php >> >> > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: on update problem?
Hi! don't think ON UPDATE is supported. The manual : http://www.innodb.com/ibman.html doesn't mention anything about it except : Starting from version 3.23.50 you can also associate the ON DELETE CASCADE or ON DELETE SET NULL clause with the foreign key constraint. EG > When I try to change the id field in the parent table below, I get the > error: 1217 - Cannot delete a parent row; a foreign key constraint fails. > > What have I got wrong? Shouldn't it cascade the changes that were made to > the parent down to the child table? > > This is done with Mysql 3.23.50-max on Windows NT > > Here is the create that I am using for the test > > CREATE TABLE parent(id INT unsigned NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; > create table child > ( > id int unsigned not null auto_increment > , parent_id int unsigned not null > , name varchar(20) null > , primary key (id) > , index parent_id(parent_id) > FOREIGN KEY (parent_id) REFERENCES parent(id) > ON UPDATE CASCADE > ) TYPE=INNODB; > > > Thanks in advance > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
on update problem?
When I try to change the id field in the parent table below, I get the error: 1217 - Cannot delete a parent row; a foreign key constraint fails. What have I got wrong? Shouldn't it cascade the changes that were made to the parent down to the child table? This is done with Mysql 3.23.50-max on Windows NT Here is the create that I am using for the test CREATE TABLE parent(id INT unsigned NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; create table child ( id int unsigned not null auto_increment , parent_id int unsigned not null , name varchar(20) null , primary key (id) , index parent_id(parent_id) FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE ) TYPE=INNODB; Thanks in advance - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php