DB-triggers/environment or CDC

Den Duze

Member
Is it possible to define some DB-triggers that will only fire in some customers environment.
But we do not want to define that trigger at the customers site itself.
So we want to manage all DB-definitions (so tables/fields/triggers/...) in our development but only at a few customers we want to execute some trigger code for some events
Is this possible? and is this advised?

I guess I can make a trigger in our development that runs some program with no-error.
Then at the customers that we want some trigger-code for this event we create that program with the codings that are requested
This way we will have some customized trigger-code that can be different for every customer that wants to do something on some event.
But again: is this an advised approch?

Or is it better to just setup some CDC system? I have no experience with this.
 

TomBascom

Curmudgeon
A whole lot depends on what you are trying to accomplish.

But… if the end goal is something that can be satisfied by CDC then I would strongly prefer that. Triggers are an ugly PITA with several significant downsides like:

1) they run 4gl code, so you have to make sure that code is available and well written (we have an active thread right now about a badly written trigger…)

2) they are specific to the 4gl engine. they don’t see SQL activity and they don’t fire for SQL code

3) they can be easily overridden or disabled by 4gl code
 
Top