Syscat.triggers valid column

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • protoclown
    New Member
    • Jan 2009
    • 1

    Syscat.triggers valid column

    DB2 on AIX. Syscat.triggers have a valid column, and apparently 'N' means the trigger is not valid. How does one set this column to 'Y' or 'N', and if you can set it to 'N', will the trigger fire? I tried the traditional UPDATE sql command to try to change the valid column, but got an error. Is this column purely used internally by DB2, in that valid would only get set to something other than 'Y' if DB2 detected an issue with the trigger?
  • Shashank1984
    New Member
    • Jul 2007
    • 26

    #2
    Gday mate,

    First of all...lemme give you different scenarios that affect the SYSCAT.TRIGGERS table's 'VALID' column in viper.

    Case #1: If you are adding a column to a table AFTER the trigger was created on the table, this will not update the dependency relationship between the table and the trigger, there is NO dependency between the new column with trigger. So, when the column is dropped, 'trigger is operated' (X) is false.

    Case #2: If you are adding a column to a table BEFORE the trigger is created on the table, since we don't have column level of dependency between table with trigger, we will consider all existing columns have dependency with the trigger. In other words, when you are dropping the column, we will assume the dependency is violated -- and we need to mark the trigger as inoperative.

    Just FYI...customers shouldn't be referencing the catalog tables directly
    Catalog tables are mainly for internal usage and they are not documented
    externally, so IBM remains the right to modify them without notifying customers. Thus, catalog tables get updated or dropped quite often from release to release, and catalog views are created for external usage to protect customers from hitting possible incompatibility across releases due to these catalog table changes.
    Applications should be written to the SYSCAT and SYSSTAT views rather than the base catalog tables

    Thanks,
    Shashank Kharche
    IBM , DB2 for Linux, Unix & Windows

    Comment

    Working...