Skip to content
Advertisement

How to set and use variable in a trigger?

I’m creating a trigger in MySQL that should set a variable and use it to update a table. But i can’t find the right syntax to make this work.

This is what i tried:

Advertisement

Answer

You probably just need a DELIMITER statement. However, you can express this as one statement:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement