Get a list of columns updated by a trigger

94 Views Asked by At

I need to display all the table columns which are updated by the triggers.

I have checked with below query but its showing only the table name, but I need table columns as well.

SELECT * FROM RDB$TRIGGERS WHERE RDB$SYSTEM_FLAG=0
1

There are 1 best solutions below

0
Mark Rotteveel On BEST ANSWER

There is no simple query which allows you to identify the columns which were updated by a trigger. You will need to inspect (or, if you want to automate it, parse) the trigger code from column RDB$TRIGGER_SOURCE to see which columns are assigned new values in the trigger code. Alternatively, you could parse the BLR (the compiled form) of the trigger from column RDB$TRIGGER_BLR to see which columns are updated, but that will take some work on your part to write a a suitable parser of the BLR.