mysql create trigger failed

enter:
CREATE TRIGGER newproducts AFTER INSERT ON products
    -> FOR EACH ROW SELECT 'Product added';
output:

ERROR 1415 (0A000): Not allowed to return a result set from a trigger


Reason: Triggers cannot use select to set variable results, which will return the result set, if the trigger (TRIGGER) is to be written in the way of into. Such as: SELECT 'Product added
';
change to:
select 'Product added' into @args;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325728358&siteId=291194637