ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

DB2 Trigger

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DB2 Trigger

    Hi Guys

    I have a trigger attached to a table A.When a record is inserted into File A, the trigger program writes a record into File B and File C. File B has a referential integrity with File C.The trigger was working fine until the server is moved physically from its place to another.

    Now eventhough the trigger is activated, records are not written into File B and C.The trigger fails to write in File C because of some issue with auto sequence number generation field.

    But I am not able to comprehend why records are not inserted into table B if the trigger is working properly...

    Did any of you guys have experienced this kinda scenario?

    Your replies are gr8ly appreciated.

    Thank You

    Regards
    Nanda...

  • #2
    Re: DB2 Trigger

    File B has a referential integrity with File C.
    The trigger fails to write in File C
    I think you answered your own question:

    The purpose of ref integrity is to prevent two files from "going out of synch". The failure in file C is probably preventing the write to file B. You will need to debug this program.

    Comment


    • #3
      Re: DB2 Trigger

      Hi Arrow

      Thanks for your reply.Actually the trigger program first writes a record into File B then into file C.So I was under the assumption that the record that is written to File B first should still be there irrespective of whether a record is written into File C or not.

      Now I think a record would have been written to file B and because of the referential integrity constraint, that record in file B should have been deleted.... Am I correct ?

      I will get the source and debug the same to find exactly what is happening.

      Thank You

      Regards
      Nanda.

      Comment


      • #4
        Re: DB2 Trigger

        are you using commitment control? maybe there's a rollback you're missing somewhere that's causing the problem.
        I'm not anti-social, I just don't like people -Tommy Holden

        Comment


        • #5
          Re: DB2 Trigger

          Hi Guys

          Thanks for ur reply... I tried clearing the file ,removing the trigger and then adding the trigger and it worked.

          Have a happy week-end.

          Regards
          Nanda.

          Comment

          Working...
          X