Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Help with Triggers

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

  • Help with Triggers

    At what point are you not able to see the old and new records? I just was playing with a trigger program yesterday, and after resetting the field for the offset to the new record was able to move and make changes to the new record befor eit got written out. You might try debugging it and do an EVAL of the parameter with a length specified so you can see the whole thing.

  • #2
    Help with Triggers

    Hi, I am having a problem with triggers. Question is I cannot see the New Buffer when trigger fires. I have done everything possible but so far no sucesses. Can you please help ? Trigger fires Before Update operation. I am on V5R1M0. Program and DDS are attached. Thanks in advance.

    UPDTRGW.txt

    Comment


    • #3
      Help with Triggers

      Hi All, Thanks for you help. This was solved. Here is the reason. The fields in the trigger buffer are not guaranteed to be contiguos - meaning the dynamic portions of the trigger buffer may not come immediately after the static portion of the buffer. That's why the static portion contains the "Offset to the Old Image" and "Offset to the new image". You need to use the actual offset value at runtime to position to the old & new image - theoretically, DB2 can change the location of the old and new record image on every execution of the trigger for the same file even if the field definitions didn't change. Finally I use RPG %ADDR function and it is fine. Thanks for your help.

      Comment

      Working...
      X