The following are the commands, tips, and notes for maintaing triggers on UniData files.
Note that triggers must be globally cataloged. However, there are ways to "trick" the system. See below.
Note that triggers must be globally cataloged. However, there are ways to "trick" the system. See below.
Command | Description | |||
---|---|---|---|---|
LIST.TRIGGER filename |
Shows the triggers associated with filename. You may have UPDATE and/or DELETE triggers. |
|||
CREATE.TRIGGER [DICT | DATA] filename program_name [BEFORE | AFTER] {UPDATE | DELETE } |
Adds the program program_name as a trigger to the file filename. You must be root to create a trigger. |
|||
DELETE.TRIGGER [DATA | DICT] filename [BEFORE | AFTER] {UPDATE | DELETE } |
Removes the program program_name as a trigger from the file filename. You must be root to create a trigger. |
|||
Only root can modify the triggers on a file. To do this, you must shell out of UniData and "su -" to root (or login a new session as root), then:
|
||||
Aurguments Note that update trigger subroutines have 5 aurguments while delete subroutine triggers have 4. Update - STATUS.FLAG, DICT.FLAG, filepointer, key, record Delete - STATUS.FLAG, DICT.FLAG, filepointer, key |
||||
All triggers must be Globally cataloged. There are two methods to do this, generally based on if the trigger already exists or not. If it does not, use method 1 otherwise use method 2. Method 1 Write a 3 line subroutine that does nothing but call a 2nd, locally catalogged subroutine. This 2nd subroutine does all the work, but can be changed between accounts. This is the preferred way to do it. Method 2 To test a change to a trigger that is already in LIVE, you must do some "smoke and mirrors" to not actually overwrite the LIVE version of the program in the universal cataloged space file (CTLGTB). From the test account, remove the trigger from the target file (see DELETE.TRIGGERabove). From the test account, GLOBALLY catalog the modified trigger program, cataloging as a different name. To do this, type: CATALOG BP temp_name trigger_name Where temp_name is a temperary, unique name. This will create a globally cataloged pointer in CTLGTB under the temp_name. For example, if the true program is called TRGS9123.1, we could type: CATALOG BP JRI.TRIGGER TRGS9999.1 To see the effects of this, type: OS.ED CTLGTB JRI.TRIGGER 001: S 002: 5 003: /av1/igi/avante94/flodata/dev/TEST94.DATA/../../../floprogs/dev/DEV.IIBASE8/BP8.0 TRGS9999.1 004: israejr (user id who cataloged the pgm) To be sure we have not clobberred the "LIVE" version, type: OS.ED CTLGTB TRGS9999.1 001: S 002: 5 003: /av1/igi/avante94/flodata/live/LIVE.DATA/../../../floprogs/live/DEV.IIBASE8/BP8.0 TRGS9999.1 004: majorlj From the test account, add the temp trigger (in this case: JRI.TRIGGER) to the target file (see CREATE.TRIGGER above) as follows: CREATE.TRIGGER filename JRI.TRIGGER UPDATE |