Kbase P160515: How to find a database trigger with virtual system tables
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  26/02/2010 |
|
Status: Unverified
GOAL:
How to find a database trigger with virtual system tables
GOAL:
How do I find the CRC of the file trigger using a VST (Virtual System Table).
GOAL:
Where is the path of the file trigger on the VST(Virtual System Table)
FACT(s) (Environment):
All Supported Operating Systems
Progress 8.3x
Progress 9.x
OpenEdge 10.x
FIX:
Schema triggers are not used in calculating database CRCs. Therefore, adding triggers will not cause the CRCs to change and your .r code will not be affected. There are however CRC values, involved with schema triggers. When the triggers are first created, you have the choice of whether or not you want CRCs used to manage your trigger code. These CRCs are separate CRC values that are computed for the trigger routines themselves. The Data Dictionary calculates these r-code CRC values and stores them in the _File-Trig (for table triggers) and _Field-Trig (for field triggers). When a database event occurs in your application that causes a schema trigger to fire, if CRC checking is enabled, the CRC value of the trigger code is compared to the CRC value stored in the metaschema file. If they do not match, Progress returns a run-time error.
For example:
- The path to the trigger will return as part of the "_Proc-Name".
- If the "check CRC" option for tables / triggers is selected, then the _trig-crc field will contain the CRC value of the procedure:
FOR EACH _file NO-LOCK:
FOR each _file-trig WHERE _file-recid = RECID(_file) NO-LOCK:
DISP _Event _Proc-Name _Override _Trig-CRC.
END.
END
To display the CRC value of a .R file:
DEFINE VARIABLE rcode-file AS CHARACTER FORMAT "x(60)"
LABEL "File".
REPEAT:
SET rcode-file WITH FRAME rc-info.
RCODE-INFO:FILE-NAME = rcode-file.
DISPLAY RCODE-INFO:CRC-VALUE LABEL "CRC"
RCODE-INFO:LANGUAGES FORMAT "x(60)" LABEL "Languages"
WITH FRAME rc-info SIDE-LABELS TITLE "R-codeCheck".
END.
NOTE:
- For security and data integrity purposes, Progress does NOT SUPPORT direct VST table manipulation. Always ensure a valid backup the database before running any code that modifies the database schema. Some errors could occur during the process of programmatically altering the schema information which could damage the database and potentially render it unusable.
- Similar information can be found on the FIELD Triggers using the _field-trig VST. Please refer to Solutions P160311 and P132334 referenced below.