ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Function to return triggered update columns?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Function to return triggered update columns?

    We need to retrieve the code that defines a trigger. Not just the code of the trigger(systriggers.action_statement) but the full create statement.

    I think we have all the elements, except for the list of columns in the UPDATE OF clause.

    This information can be retrieved as follows:

    SELECT TRIGGERED_UPDATE_COLUMNS FROM QSYS2.SYSTRIGUPD where EVENT_OBJECT_SCHEMA = '%s' and EVENT_OBJECT_TABLE='%s' and TRIGGER_NAME='%s'

    What we need to do is create a function accepting 3 parameters Table Library, Table Name, Trigger Name and will return a comma delimited list of the triggered update columns based on the query above. If the query returns no rows, the function should return ''. The function will be called within the SQL statement retrieving the Triggers.

    Can anyone assist me in writing this function?


  • #2
    Re: Function to return triggered update columns?

    Give a look here to see if this helps then let us know.

    http://www.code400.com/forum/showthr...hlight=trigger
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment

    Working...
    X