|
Paul, You should figure out what you want to do if there is a problem in the trigger (for instance, if the stats file is locked by another job or whatever). Do you want to stop the write to the transaction file, or go ahead with it anyway? Ensure you build full error-handling into your trigger program and code defensively... Very defensively. If you're worried about a performance hit (as Todd mentions) you could consider writing a trigger program which puts the transaction details (or whatever it is you want to log into your stats file) onto a data queue and then returns control to the database manager, rather than actually writing to the stats file itself. That way, the trigger program runs very quickly, and the data queue receiver program (which you will also have to write) can be the one which actually writes the record into the stats file. It's a more complex solution, but you're less likely to hit performance issues. However, you can't use this type of processing to stop a transaction from occurring, if that's what you want to do. Check on posts from Alan Campin (either in this forum or in the MIDRANGE-L forum) from the last couple of months - he wrote a generic 'trigger mediator' which may include data queue functionality. I wrote one a year ago, but it's my company's property, so I can't share it. Either way, Alan's stuff may be a good start on what you want to acheive if you haven't worked with trigger programs before. HTH, Rory
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.