Kbase P133187: 4GL/ABL: How to programmatically create a field ASSIGN trigger?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/14/2009 |
|
Status: Verified
GOAL:
4GL/ABL: How to programmatically create a field ASSIGN trigger?
GOAL:
How to programmatically create a table DELETE trigger?
GOAL:
How to add a database event table trigger using 4GL / ABL?
FACT(s) (Environment):
All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x
FIX:
WARNING: Make sure to 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.
1. The following procedure creates a field ASSIGN trigger for the Carrier field of the Order table of the Sports2000 database:
FIND _File NO-LOCK WHERE _File-Name = "Order".
FIND _Field NO-LOCK OF _file WHERE _Field-Name = "Carrier".
CREATE _Field-Trig.
ASSIGN
_Field-Trig._Field-Recid = RECID(_Field)
_Field-Trig._File-Recid = RECID(_File)
_Field-Trig._Event = "ASSIGN"
_Field-Trig._Proc-name = "CarrierFieldAssignTrigger.p"
_Field-Trig._Override = FALSE
_Field-Trig._Trig-Crc = ?
_Field-Trig._Last-modified = TODAY
_Field-Trig._Mod-sequence = ?.
MESSAGE "Finished creating the ASSIGN trigger for the Carrier field of the Order Table"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
2. The following procedure creates a database DELETE event trigger for the Order table of the Sports2000 database:
FIND _File NO-LOCK WHERE _File-Name = "Order".
CREATE _File-Trig.
ASSIGN
_File-Trig._File-Recid = RECID(_File)
_File-Trig._Event = "DELETE"
_File-Trig._Proc-name = "OrderTableDeleteTrigger.p"
_File-Trig._Override = FALSE
_File-Trig._Trig-Crc = ?
_File-Trig._Last-modified = TODAY
_File-Trig._Mod-sequence = ?.
MESSAGE "Finished creating the DELETE event trigger for the Order Table"
VIEW-AS ALERT-BOX INFO BUTTONS OK.