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 > Pitfalls to avoid for use of Triggers in V7

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-09-05, 07:12
ggnanaraj ggnanaraj is offline
Registered User
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 171
Pitfalls to avoid for use of Triggers in V7

Triggers can improve performance. However, are there any known pitfalls to avoid?

What is the overhead of using a Trigger like an audit tool for moving the 'old image of records changed' to another table before UPDATE?

TIA.
Reply With Quote
  #2 (permalink)  
Old 12-09-05, 08:47
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by ggnanaraj
Triggers can improve performance.
Are you sure about that?
Reply With Quote
  #3 (permalink)  
Old 12-09-05, 09:47
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
One thing to think about when considering using a trigger: If the trigger is NOT used, then the audit may have to be done by the application. If you require that an audit trail be kept, then why not used a trigger? Can the application perform better than the DBMS? Without the triggers, there will be ways to circumvent the audit by using ad-hoc queries to get to the data.
Reply With Quote
  #4 (permalink)  
Old 12-09-05, 13:18
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Please note , you cannot 'move' a old row into another table as part of BEFORE trigger .. You'll have to use the AFTER Trigger OLD ROW ..

Sathyaram

Quote:
Originally Posted by ggnanaraj
Triggers can improve performance. However, are there any known pitfalls to avoid?

What is the overhead of using a Trigger like an audit tool for moving the 'old image of records changed' to another table before UPDATE?

TIA.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
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