Professional Web Applications Themes

DB2 trigger not kicking off - IBM DB2

Pouya wrote: > OK, > > I'm having a problem getting triggers to kick off on an AIX box. I > have implemented this same database/triggers on an NT box and the > triggers are working properly. Can triggers be turned off on DB2? I'm > trying to figure out what could hinder triggers from working... could > it be an AIX thing? > > *** I did not install/configuration DB2 on AIX so I'm taking another > engineers word for it, but did do the install/configuration on NT > > *** An example of a trigger in question is: ...

  1. #1

    Default Re: DB2 trigger not kicking off

    Pouya wrote:
    > OK,
    >
    > I'm having a problem getting triggers to kick off on an AIX box. I
    > have implemented this same database/triggers on an NT box and the
    > triggers are working properly. Can triggers be turned off on DB2? I'm
    > trying to figure out what could hinder triggers from working... could
    > it be an AIX thing?
    >
    > *** I did not install/configuration DB2 on AIX so I'm taking another
    > engineers word for it, but did do the install/configuration on NT
    >
    > *** An example of a trigger in question is:
    > CREATE TRIGGER GENERATE_PART_ID NO CASCADE BEFORE INSERT ON Episode
    > REFERENCING NEW AS n FOR EACH ROW MODE DB2SQL SET ( n . pid ) = case
    > when ( select max ( isnewpid ) from gainIDSetting ) = 1 then ( select
    > max ( pidStartID ) from gainIDSetting ) else ( select max ( PID ) + 1
    > from episode ) END
    What is the symptom/problem you are seeing? Are you performing an insert
    into the Episode table and the values inserted don't reflect the changes
    you expect to be performed by the trigger?
    You cannot turn off triggers in DB2 for SQL statements. There are
    utilties that don't fire triggers (for example LOAD). I doubt this is
    anything AIX specific. I would start with verifying that the trigger
    has in fact been created correctly. There should be an entry for it in
    the SYSCAT.TRIGGERS catalog view.

    Regards,
    Miro

    miro flasza Guest

  2. #2

    Default Re: DB2 trigger not kicking off

    [email]psafasysinct.com[/email] (Pouya) wrote in message news:<ef4a87ef.0307091017.163584a2posting.google. com>...
    > OK,
    >
    > I'm having a problem getting triggers to kick off on an AIX box. I
    > have implemented this same database/triggers on an NT box and the
    > triggers are working properly. Can triggers be turned off on DB2? I'm
    > trying to figure out what could hinder triggers from working... could
    > it be an AIX thing?
    >
    > *** I did not install/configuration DB2 on AIX so I'm taking another
    > engineers word for it, but did do the install/configuration on NT
    >
    > *** An example of a trigger in question is:
    > CREATE TRIGGER GENERATE_PART_ID NO CASCADE BEFORE INSERT ON Episode
    > REFERENCING NEW AS n FOR EACH ROW MODE DB2SQL SET ( n . pid ) = case
    > when ( select max ( isnewpid ) from gainIDSetting ) = 1 then ( select
    > max ( pidStartID ) from gainIDSetting ) else ( select max ( PID ) + 1
    > from episode ) END
    Not much help, but have you verified that the triggers are in place?
    If yo have access to the database, yo can try something like:

    select * from syscat.triggers where trigname = 'GENERATE_PART_ID'"

    if the trigger exists, you should see at least one row returned.

    As far as I can tell there is no way that you can "turn off" a trigger
    by mistake. In fact, I have seen a few posts where people are
    wondering how on earth they are going to disable a trigger
    temporarely.

    /Lennart
    Lennart Jonsson Guest

  3. #3

    Default Re: DB2 trigger not kicking off

    [email]lennartkommunicera.umea.se[/email] (Lennart Jonsson) wrote in message news:<6dae7e65.0307100919.4ca000f0posting.google. com>...
    > Not much help, but have you verified that the triggers are in place?
    > If yo have access to the database, yo can try something like:
    >
    > select * from syscat.triggers where trigname = 'GENERATE_PART_ID'"
    >
    > if the trigger exists, you should see at least one row returned.
    Also, check column VALID to ensure your triggers are still operative.


    Jeremy Rickard
    Jeremy Rickard Guest

  4. #4

    Default Re: DB2 trigger not kicking off

    Are you doing multirow-inserts? Your max() wil not change for every row
    if that's your problem. The trigger definition as is works only for
    single row inserts.

    Cheers
    Serge

    --
    Visit the DB2 UDB and DB2 Connect Online Support site at:
    [url]http://www.ibm.com/software/data/db2/udb/winos2unix/support[/url]

    Serge Rielau Guest

Similar Threads

  1. Remote Shared Object kicking my butt
    By jonpor in forum Macromedia Flash Flashcom
    Replies: 1
    Last Post: July 14th, 11:14 PM
  2. XML.TRIGGER
    By Dan-C in forum Macromedia Flash Data Integration
    Replies: 1
    Last Post: February 28th, 03:55 PM
  3. Trigger
    By James in forum ASP Database
    Replies: 1
    Last Post: August 6th, 01:05 AM
  4. Kicking users
    By Aaron in forum Debian
    Replies: 5
    Last Post: August 3rd, 02:40 AM
  5. Trigger key
    By Elisabeth Smith in forum Microsoft SQL / MS SQL Server
    Replies: 0
    Last Post: July 2nd, 09:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139