Tenho uma tabela que tem um campo unique, foi excluído um registro dessa tabela e agora deseja-se inseri-lo novamente, no entanto o MySQL me gera o erro: "Error Code: 1062. Duplicate entry '' for key ''". Como posso solucionar isso?
CREATE DA TABELA:
CREATE TABLE `bem` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`cpf` varchar(17) NOT NULL,
...
PRIMARY KEY (`id`),
UNIQUE KEY `cpf` (`cpf`)
) ENGINE=InnoDB AUTO_INCREMENT=1764 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
EXEMPLO DE INSERT:
INSERT INTO `bem` (cpf, ...)VALUES ('12312312312', ...);
CREATE TABLE
e também a query deINSERT
que está fazendo.excluido
ouativo
? pq basicamente o cpf do insert já existe na tabela.