Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am eventually going to be writing a trigger on a field named "user2". Currently most of the values in this field are blank, but there are some seemingly random rows with values of '00' for the field.

What I was wondering, is there anyway to determine if there is an existing trigger that is adding these values to the field? If not, what are some methods I can use to figure out how this data is getting there?

Thanks,

Andrew

share|improve this question
    
Which member of the DB2 family are you asking about? DB2 for i, z, or LUW? –  WarrenT Apr 3 '13 at 20:01
add comment

1 Answer

If you are asking if you can determine if the table in question has any triggers defined, then yes - you can either

  • Look at the view SYSCAT.TRIGGERS, filtering on the TABSCHEMA and TABNAME columns
  • Extract the DDL for the table using the db2look command.

If you are asking if there's any way to determine whether existing rows that have a value were updated as a result of an existing trigger, then the answer is no. There is nothing inherent to triggers that would allow you to identify them as the source of the data in the column. The trigger could contain some logic to identify itself as the source of the value, but that would be stored in some other column or table.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.