2
I’m having an error trying to execute this command:
DELETE doacoes FROM doacoes LEFT OUTER JOIN animais ON animais.idAnimal = doacoes.idAnimalDoacao WHERE animais.idAnimal = doacoes.idDoacao;
I want to delete one DONATION, where the ANIMAL is deleted at the same time.
You keep making that mistake:
Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.
This is happening in mysql. How would the code?
– Bolaxano
How is the relationship between the donation tables and animals? The clauses UPDATE CASCADE and DELETE CASCADE would not meet your needs?
– anonimo
It’s because I’m new to this area. I have the Animal and Donation table. When I add an animal, the animal ID goes to the DOACAO table as idAnimalDoacao, thus creating a donation
– Bolaxano
What database are you using? Mysql or SQL Server? In the comment you referred to Mysql but your question is marked as
sql-server
, correct the information!– Matheus Ribeiro
I am using Mysql. Sorry
– Bolaxano