Ver Mensaje Individual
  #19 (permalink)  
Antiguo 29/04/2011, 15:05
Avatar de RIVERMILLOS
RIVERMILLOS
 
Fecha de Ingreso: marzo-2010
Mensajes: 1.336
Antigüedad: 14 años, 2 meses
Puntos: 15
Respuesta: Duda con truncate.

Hola mira ya realice todo lo que dijiste que tenias razon habian cosas como las que mencionas pero ya las modifique pero me sigue daliendo lo mismo esto...


Código:
#1701 - Cannot truncate a table referenced in a foreign key constraint (`ortegayb_btc`.`reglasxpropiedades`, CONSTRAINT `idreglas_fk_reglasxpropiedades` FOREIGN KEY (`idreglas`) REFERENCES `ortegayb_btc`.`reglaspropiedades` (`idreglas`))


Código MySQL:
Ver original
  1. CREATE  TABLE IF NOT EXISTS `ortegayb_btc`.`reglaspropiedades` (
  2.   `idreglas` INT NOT NULL AUTO_INCREMENT ,
  3.   `mensaje` LONGTEXT NOT NULL ,
  4.   `imagen` MEDIUMTEXT NULL ,
  5.   `valor` VARCHAR(100) NULL ,
  6.   `idtitulo` INT NOT NULL ,
  7.   `idaccionesreglas` INT NOT NULL ,
  8.   PRIMARY KEY (`idreglas`) ,
  9.   INDEX `idtitulo_fk_reglaspropiedades` (`idtitulo` ASC) ,
  10.   INDEX `idaccionesreglas_fk_reglaspropiedades` (`idaccionesreglas` ASC) ,
  11.   CONSTRAINT `idtitulo_fk_reglaspropiedades`
  12.     FOREIGN KEY (`idtitulo` )
  13.     REFERENCES `ortegayb_btc`.`titulos` (`idtitulos` )
  14.   CONSTRAINT `idaccionesreglas_fk_reglaspropiedades`
  15.     FOREIGN KEY (`idaccionesreglas` )
  16.     REFERENCES `ortegayb_btc`.`accionesreglas` (`idaccionesreglas` )
  17.  
  18. CREATE  TABLE IF NOT EXISTS `ortegayb_btc`.`reglasxpropiedades` (
  19.   `idreglas` INT NOT NULL ,
  20.   `idpropiedad` INT(100) NOT NULL ,
  21.   INDEX `idreglas_fk_reglasxpropiedades` (`idreglas` ASC) ,
  22.   INDEX `idpropiedades_fk_reglasxpropiedades` (`idpropiedad` ASC) ,
  23.   PRIMARY KEY (`idreglas`, `idpropiedad`) ,
  24.   CONSTRAINT `idreglas_fk_reglasxpropiedades`
  25.     FOREIGN KEY (`idreglas` )
  26.     REFERENCES `ortegayb_btc`.`reglaspropiedades` (`idreglas` )
  27.   CONSTRAINT `idpropiedades_fk_reglasxpropiedades`
  28.     FOREIGN KEY (`idpropiedad` )
  29.     REFERENCES `ortegayb_btc`.`propiedades` (`idpropiedad` )
  30.  
  31.  
  32. CREATE  TABLE IF NOT EXISTS `ortegayb_btc`.`preguntas` (
  33.   `idpreguntas` INT NOT NULL AUTO_INCREMENT ,
  34.   `idreglas` INT NOT NULL ,
  35.   `clase` VARCHAR(45) NOT NULL ,
  36.   `metodo` VARCHAR(45) NOT NULL ,
  37.   `valor` VARCHAR(100) NOT NULL ,
  38.   PRIMARY KEY (`idpreguntas`) ,
  39.   INDEX `idreglas_preguntas2op` (`idreglas` ASC) ,
  40.   CONSTRAINT `idreglas_preguntas2op`
  41.     FOREIGN KEY (`idreglas` )
  42.     REFERENCES `ortegayb_btc`.`reglaspropiedades` (`idreglas` )

asi quedaron las tablas. despues de la modificaion no se que mas pueda ser?


saludos