SQL Function to return triggered update columns?

Tags:
IBM DB2
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? Thanks, wdd ddaugherty@teamair.com

Answer Wiki

Thanks. We'll let you know when a new response is added.

there is a retrieve sql statement api in the 400.
I have made an interface on it.
it is at http://jplamontre.free.fr/AS400/RTVSQL.htm.
try it and feed back, I never have tested it on a sql trigger.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Faddydaddy1951
    Merci, Jean-Paul Lamontre, de votre reponse prompte. Les ressembler de solution a elle fonctionneront bien pour de ce que j'ai besoin. La vie est bonne ! Thank you, Jean-Paul Lamontre, for your prompt response. The solution looks like it will work well for what I need. Life is good!
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following