If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Help needed : DB2 Error Handling in triggers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-23-05, 04:23
jf.langella jf.langella is offline
Registered User
 
Join Date: Feb 2005
Posts: 3
Question 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
Reply With Quote
  #2 (permalink)  
Old 11-23-05, 04:57
przytula przytula is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 11-23-05, 06:08
jf.langella jf.langella is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 11-23-05, 06:28
bala_e bala_e is offline
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old 11-23-05, 07:59
jf.langella jf.langella is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On