Miguel, if you are running MySQL-4.0.13, please use
SHOW INNODB STATUS to look at a detailed error message of the latest foreign key error. Best regards, Heikki Tuuri Innobase Oy http://www.innodb.com Transactions, foreign keys, and a hot backup tool for MySQL Order MySQL technical support from https://order.mysql.com/ ----- Original Message ----- From: ""Miguel Perez"" <[EMAIL PROTECTED]> Newsgroups: mailing.database.mysql Sent: Sunday, June 15, 2003 12:27 AM Subject: Can't delete on cascade > Hi every one does anyone know if there are bugs on the statement ON DELETE > CASCADE, cause I have 2 tables as follows: > > Reparacion |CREATE TABLE `Reparacion` ( > `folio` bigint(19) NOT NULL default '0', > `idTipo` int(4) NOT NULL default '0', > `idAlmacen` int(4) NOT NULL default '0', > `idStatusGeneral` int(2) NOT NULL default '0', > `usuario` varchar(16) NOT NULL default '', > `idProducto` int(11) NOT NULL default '0', > `fechaEntrada` date NOT NULL default '0000-00-00', > `observacion` varchar(255) default NULL, > `tecnico` varchar(100) NOT NULL default '', > `numSerie` varchar(20) NOT NULL default '', > `idCausaCancelacion` int(4) NOT NULL default '0', > PRIMARY KEY (`folio`,`idTipo`), > KEY `IDX4018` (`idAlmacen`), > KEY `IDX3309` (`idTipo`), > KEY `IDX3938` (`idStatusGeneral`), > KEY `IDX5631` (`usuario`), > KEY `IDX5623` (`idProducto`), > KEY `IDX1475` (`idCausaCancelacion`), > FOREIGN KEY (`idCausaCancelacion`) REFERENCES > `refacciones.CausaCancelacion` (`idCausaCancelacion`) ON DELETE CASCADE, > FOREIGN KEY (`idTipo`) REFERENCES `refacciones.Tipo` (`idTipo`), > FOREIGN KEY (`idAlmacen`) REFERENCES `refacciones.Almacen` (`idAlmacen`), > FOREIGN KEY (`idStatusGeneral`) REFERENCES `refacciones.StatusGeneral` > (`idStatusGeneral`), > FOREIGN KEY (`usuario`) REFERENCES `refacciones.Empleado` (`usuario`), > FOREIGN KEY (`idProducto`) REFERENCES `refacciones.Producto` > (`idProducto`) > ) TYPE=InnoDB COMMENT='Reparacion' > > RefaccionReparacion | CREATE TABLE `RefaccionReparacion` ( > `folio` bigint(19) NOT NULL default '0', > `idTipo` int(4) NOT NULL default '0', > `idRefaccion` int(11) NOT NULL default '0', > `cantidad` int(11) NOT NULL default '0', > `cantidadSolicitada` int(11) NOT NULL default '0', > PRIMARY KEY (`folio`,`idTipo`,`idRefaccion`), > KEY `IDX2530` (`folio`), > KEY `IDX3220` (`idTipo`), > KEY `IDX4101` (`idRefaccion`), > FOREIGN KEY (`folio`) REFERENCES `refacciones.Reparacion` (`folio`) ON > DELETE CASCADE, > FOREIGN KEY (`idTipo`) REFERENCES `refacciones.Tipo` (`idTipo`) ON DELETE > CASCADE, > FOREIGN KEY (`idRefaccion`) REFERENCES `refacciones.Refaccion` > (`idRefaccion`) ON DELETE CASCADE > ) TYPE=InnoDB COMMENT='Reparacion' > > > In the child table, I have the on delete cascade, but it doesn't work comes > out the next error: > "Cannot delete a parent row: a foreign key constraint fails" > > Any ideas. > > Thnx in advanced. > > Greetings > > _________________________________________________________________ > Charla con tus amigos en línea mediante MSN Messenger: > http://messenger.microsoft.com/es > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]