Starting in Version 9.7 Fix Pack 1, you can nest global variable assignments in compiled user-defined functions (UDFs) and compiled triggers.
For example, a trigger activated by an INSERT statement can update a global variable.