Answer the question
In order to leave comments, you need to log in
How to stop an INSERT query if a condition is not met?
Hello. There is a table "Limit" with the structure factory, material, limit
And there is a table Shipment where requests will be entered when the factory asks to take some material. How to write a trigger to check if the request is more than the limit, then do not execute. Example of inserting into the Shipping table
INSERT INTO `Отгрузка ` (`factory`, `material`, `kol`) VALUES ( 'фабрика1', 'дерево', '127', )
INSERT INTO `Лимит` (`factory`, `material`, `kol`) VALUES ( 'фабрика1', 'дерево', '100', )
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question