0
When trying to insert a new data into a given table (employee), I have a column called "manager ID" which is FK from the table itself "employee".
During the registration I send the ID of another employee in this column, only it is returning that I already have the value registered in the column. And I do, but it’s not meant to be. Because I have a column that performs the same function called "empresaID" which is FK too, but from another table, but there is the problem of duplicate values.
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '10' for key 'gerenteID'
Index is not blocking duplicate values?
– Roberto de Campos
You didn’t put the column
gerenteID
asUNIQUE
?– rbz
I got it handled, guys. Dei um SHOW INDEX FROM 'table' , and then an ALTER TABLE 'table' DROP INDEX 'key'
– Kennedy Anderson