Altering triggers

You can make changes to existing triggers, such as modifying the attributes and versions.

About this task

Use the AL line command to make changes that can made by an ALTER TRIGGER statement. Use the ALT command to make other changes.

Procedure

To alter a trigger:

  1. On the DB2 Administration Menu (ADB2) panel, select option 1, and press Enter.
  2. On the System Catalog (ADB21) panel, select option J, and press Enter.
  3. On the Triggers (ADB21J) panel, specify the AL or ALT line command.
    This example assumes that you want to make a simple change that can be achieved by using an ALTER statement and therefore uses the AL line command:
    Figure 1. Triggers (ADB21J)
    ADB21J in                      DD1A Triggers                    Row 59 from 78 
    Command ===>                                                  Scroll ===> CSR  
                                                                                   
    Type line commands in the Select column, then press Enter.                     
                                                                                   
    Line commands:                                                                 
     D - Database  T - Table  K - Package  A - Schema auth  I - Interpretation     
     GEN - Generate DDL  Drop - Drop  COM - Comment  CRE - Create  AL - Alter      
     ? - Show all line commands                                                    
                                              Table/   Table/                      
                                              View     View               Created  
    S    Schema   Name     Owner   Version  A Schema   Name         T E G By       
         *        *        RIVERAF *        * *        *            * * * *        
    ---- -------- -------> ------- -------- - -------- ------------ - - - -------- 
         RIVERAF  TRFGRTRX RIVERAF            RIVERAF  TBFGRTR      A U R RIVERAF  
         RIVERAF  TRFGRZR  RIVERAF V1       Y RIVERAF  TBFGRTR      A U R RIVERAF  
    AL   RIVERAF  TRFGRZR  RIVERAF V2       N RIVERAF  TBFGRTR      A U R RIVERAF  
         RIVERAF  TRFGRZR  RIVERAF V3       N RIVERAF  TBFGRTR      A U R RIVERAF  
    ******************************* END OF DB2 DATA *******************************
    

    The remaining instructions apply to the AL line command. For instructions on how to use the ALT line command, see ALT (Alter) function.

    One of the following versions of the Alter Trigger (ADBPJA) panel is displayed:
    • Options for editing trigger versions:
      Figure 2. Alter Trigger (ADBPJA) panel
      ADBPJA in ---------------------- DD1A Alter Trigger --------------------- 15:34
      Command ===>                                                                   
                                                                                     
                                                                                     
       ALTER TRIGGER "RIVERAF"."TRFGRZR"                                             
                                                                                     
       Specify a choice of operation from one of the following options.              
                                                                                     
        1 1  ALTER VERSION (default)                                                 
          2  REPLACE VERSION                                                         
          3  ADD VERSION                                                             
          4  ACTIVATE VERSION                                                        
          5  REGENERATE VERSION                                                      
          6  DROP VERSION                                                            
                                                                                     
       Specify a choice of version:                                                  
        1 1  VERSION . . . . V2                  > (? to look up version id)         
          2  ACTIVE VERSION (default, if no version id specified)                    
      
    • Basic options:
      Figure 3. Alter Trigger (ADBPJA) panel
      ADB21JA n ---------------------- DC1A Alter Trigger --------------------- 17:06
      Command ===>                                                                   
                                                                                     
       ALTER TRIGGER                                                                 
                                                                                     
       Schema . . . . . . DSNIBMTS                 (Optional)                        
       Name . . . . . . . CONNECTINFOCONSTRA  >    (? to look up)                    
                                                                                     
       SECURED  . . . . .                          (Yes/No)                          
                                                                                     
                                                                                     
  4. On the Alter Trigger (ADBPJA) panel specify the appropriate options, and press Enter.
  5. If the Alter Trigger (ADBPJA1) panel is displayed, specify your changes, and issue the NEXT command.
    Db2 Admin Tool issues an ALTER TRIGGER statement to make the changes.