G
G
GmDvlpr2020-04-19 18:06:11
MySQL
GmDvlpr, 2020-04-19 18:06:11

How to create a trigger that does not allow adding / deleting / changing under certain conditions?

Something I'm just not trying to find, but I want to find a solution as soon as possible, I'll just leave this question here, maybe someone will answer

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ayazer, 2020-04-19
@GmDvlpr

create trigger <trigger_name> before insert on <table_name>
for each row
begin
if new.val = '' then
signal sqlstate '45000';
end if;
end;$$

and similar triggers for before delete/before update
but it all looks like a very nasty bone to prop up the system. And I suspect that the problem should not be solved in this way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question