dynamically access columns in trigger
dynamically access columns in trigger
От:
Daniel Schuchardt <d.schuchardt@prodat-sql.de>
Дата:
Hy, i need to have some idea how to dynamically access columns in a trigger. Use/Case: We have a workflowmodule. In different cases different workflows should be fired. In the Workflowdefinitiontable, we say "tablename, when". so e.g. ~~table 1 -> insert~~ ~~table 2 -> update~~. We have a central trigger that fires on all tables. Inside the trigger i evaluate with "TG_REL_NAME=wf_tablename" -> start workflow. Now the problem is that there are different workflows in the update case. e.g. if the price changes, a "CheckNewPrice" workflow is startet, if a date changes a "CheckNewDeliveryDate" workflow is started. My idea is to give my workflowdefinitiontable a additional column the holds the condition, e.g. ~~table 2 -> update -> ~~~~~ new.pricecolumn<>old.pricecolumn ~~~ so i need a solution how to evaluate that dynamic statement in my global trigger funktion. Any ideas? -- Daniel Schuchardt /Softwareentwicklung/ /http://www.prodat-sql.de/