-1
I have to make a Rigger, where when being excluded an employee will also be excluded his dependent. But I can not delete. the code was like this:
delimiter $
create trigger TRG_excluiDependente_AD
after delete
on Funcionario
for each row
begin
-- alter table Dependente drop foreign key ID_Func;
delete from Dependente where Dependente.ID_Func = old.ID_Func;
end$
delimiter ;
drop trigger TRG_excluiDependente_AD;
alter table Dependente DROP foreign key fk_dep_func ;
delete from Funcionario where ID_Func = 4;
And returns me the title error,and I’ve removed the function->dependent FK
on the dependent table references the function? if yes you only put a "delete on Cascade" that solves your problem
– Henrique Lemes Baron
yes, but the thing is I can’t use Scade
– Marques