Consultor Eletrônico



Kbase P136024: Is there a way to send a parameter to a DB trigger from a 4GL program?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   09/03/2009
Status: Verified

GOAL:

Is there a way to send a parameter to a DB trigger from a 4GL program?

GOAL:

Can database schema triggers have input parameters from an ABL program?

FACT(s) (Environment):

All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x

FIX:

There is no way to pass a parameter from a 4GL program into a trigger directly.

However, as the schema triggers execute within the context of the client session, they will have the ability to call functions and internal procedures from the other (persistent) procedures in that session. So to achieve this indirectly:
- Have the main logic store the required values in a persistent procedure at an appropriate time
- Have the schema trigger retrieve the values from this persistent procedure via get functions

Note that if using database schema triggers rather than session triggers, then those triggers will always require the presence of these persistent procedures (mentioned above) even in the context of normal DBA work when the application isn't being run. This can be a significant issue, particularly in the presence of an emergency dump-and-load. To avoid issues like that, the developer could write code that would interact with the application logic in the context of session-based triggers instead. However, the exact implementation is left up to the developer.