MySql Error 1005 errno 22

Help when I try to create this table

CREATE TABLE `sepetbol`.`ManRInMv|` (
  `CodResIns` INTEGER UNSIGNED NOT NULL COMMENT 'codigo resultado inspeccion',
  `FecResIns` DATETIME NOT NULL COMMENT 'Fecha de resultado de Inspeccion',
  `ConActual` INTEGER UNSIGNED NOT NULL COMMENT 'Contador Actual',
  `TieDuracion` INTEGER UNSIGNED NOT NULL COMMENT 'Tiempo Duracion de la Inspeccion',
  `ImaDoc` LONGBLOB COMMENT 'Imagen del Documento',
  `DesTipCod` VARCHAR(4) COMMENT 'Descripcion del Tipo de Doc',
  `CodMecanico` INTEGER UNSIGNED NOT NULL COMMENT 'Codigo Empleado Mecanico',
  `CodObra` INTEGER UNSIGNED NOT NULL COMMENT 'Codigo de Obra',
  `CodEquipo` INTEGER UNSIGNED NOT NULL COMMENT 'Codigo de Equipo',
  PRIMARY KEY(`CodResIns`),
  CONSTRAINT `FK_CodMecanicoRIn` FOREIGN KEY `FK_CodMecanicoRIn` (`CodMecanico`)
    REFERENCES `rhuempme` (`CodEmp`)
    ON DELETE RESTRICT
    ON UPDATE RESTRICT,
  CONSTRAINT `FK_CodObraRIn` FOREIGN KEY `FK_CodObraRIn` (`CodObra`)
    REFERENCES `genobrme` (`CodObra`)
    ON DELETE RESTRICT
    ON UPDATE RESTRICT,
  CONSTRAINT `FK_CodEquipoRIn` FOREIGN KEY `FK_CodEquipoRIn` (`CodEquipo`)
    REFERENCES `almequme` (`CodEqu`)
    ON DELETE RESTRICT
    ON UPDATE RESTRICT

COMMENT = 'Resultado de Inspeccion';

Constraints are also not incopatibilidad non-duplicate data types.

I searched the net about this arrangement ... and there is nothing that could solve my problems

+4
source share
1 answer
  • close the create table syntax, for example:

    create a table (field ...);

Right now it is not closing with an end bracket.

  • Please check if the whole data type of your main tables is “unsigned integer”, just change if they are different in any master table and it will work.
0
source

Source: https://habr.com/ru/post/1538240/


All Articles