Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2005
    Posts
    3

    Question Unanswered: Help needed : DB2 Error Handling in triggers

    Hello,
    I have a question about triggers.
    I have a table A and a table B (in another tablespace)
    I added 2 triggers on A (on insert and on update on table A)
    The triggers do an insert into B when insert or update occurs on A
    My problem is the following: When tablespace of B is full (trigger cannot do its work), the insert in A is not done .

    Is there a way to have the insert in A done even if something happen in trigger processing...

    Any help will be appreciate .
    Thanks
    JF

  2. #2
    Join Date
    Nov 2004
    Posts
    374

    trigger

    no, I don't think so : triggers and statement should both be executed or none
    Best Regards, Guy Przytula
    DB2/ORA/SQL Services
    DB2 DBA & Advanced DBA Certified
    DB2 Dprop Certified
    http://users.skynet.be/przytula/dbss.html

  3. #3
    Join Date
    Feb 2005
    Posts
    3

    Help needed : DB2 Error Handling in triggers

    Thanks for you reply . Do you think that it could be performed by a stored procedure called by the trigger and that the trigger can don't care about stored procedure result ?
    Thanks for your help
    JF

  4. #4
    Join Date
    Jan 2004
    Posts
    49
    Quote Originally Posted by jf.langella
    Hello,
    I have a question about triggers.
    I have a table A and a table B (in another tablespace)
    I added 2 triggers on A (on insert and on update on table A)
    The triggers do an insert into B when insert or update occurs on A
    My problem is the following: When tablespace of B is full (trigger cannot do its work), the insert in A is not done .

    Is there a way to have the insert in A done even if something happen in trigger processing...

    Any help will be appreciate .
    Thanks
    JF
    Are you Inserting / updating data into table A through SP? if so, you can handle Insert / Update data into table B within the same SP or another SP but with data Synchronization like through error handle roll back the transaction on table A too.

  5. #5
    Join Date
    Feb 2005
    Posts
    3

    DB2 Error Handling in triggers

    Currently the trigger is very simple without any SP.

    CREATE TRIGGER feed_webtec1 \
    AFTER INSERT ON TEC_T_EVT_REP \
    REFERENCING NEW AS e \
    FOR EACH ROW MODE DB2SQL \
    BEGIN ATOMIC \
    INSERT INTO webtec (TS, DATE_RECEPTION, SERVER_HNDL, EVENT_HNDL, STATUS) \
    values ( \
    CURRENT TIMESTAMP, \
    e.DATE_RECEPTION, \
    e.SERVER_HNDL, \
    e.EVENT_HNDL, \
    e.STATUS \
    ); \
    END

    Is there a way to ignore trigger result and so insert on TEC_T_EVT_REP will be perform in any cases ???
    Thanks for your help
    JF

Posting Permissions

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