Where allowed to run: All environments (*ALL) Threadsafe: Conditional |
Parameters Examples Error messages |
The Remove Physical File Trigger (RMVPFTRG) command removes the triggers that call trigger programs from a specified physical file. The triggers to be removed can be specified by trigger events, trigger times or trigger name. A trigger program is a program that has been added to the specified physical file by the Add Physical File Trigger (ADDPFTRG) command (system trigger) or the SQL CREATE TRIGGER statement (SQL trigger).
If a trigger time, trigger event and trigger name are specified and the trigger time and event do not match the time and event for the trigger definition name, the trigger will not be removed.
Once a trigger is removed from the physical file for a specified trigger time or event or name, the trigger program is no longer called when the trigger event occurs within the file. If the trigger was a system trigger, the trigger program continues to exist on the system. If the trigger was an SQL trigger, the trigger program is deleted.
An exclusive-no-read lock is held on the physical file when removing the trigger from that file. All logical files which are built over the physical file are also held with the exclusive no-read lock.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
FILE | Physical file | Qualified object name | Required, Positional 1 |
Qualifier 1: Physical file | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
TRGTIME | Trigger time | *ALL, *BEFORE, *AFTER | Optional, Positional 2 |
TRGEVENT | Trigger event | *ALL, *INSERT, *DELETE, *UPDATE, *READ | Optional, Positional 3 |
TRG | Trigger | Character value, *ALL | Optional |
TRGLIB | Trigger library | Name, *FILE, *CURLIB | Optional |
Top |
Specifies the physical file from which the trigger is to be removed. The specified file must exist on the system.
This is a required parameter.
Qualifier 1: Physical file
Qualifier 2: Library
Top |
Specifies the trigger to be removed, based on the time when the trigger program is called.
Top |
Specifies the trigger event for which the associated triggers are removed.
Top |
Specifies the name of the trigger being removed.
The following are examples of the TRG parameter dependencies:
Top |
Specifies the library for the trigger being removed.
Note: The special values *LIBL and *CURLIB are the values of the job running when the trigger is removed.
Top |
Example 1: Removing All Triggers for Insert Events
RMVPFTRG FILE(EMP) TRGEVENT(*INSERT)
This command removes all triggers for programs called by insert operations from the physical file named EMP.
Example 2: Removing All Triggers for Programs Called Before a Trigger Event
RMVPFTRG FILE(EMP) TRGTIME(*BEFORE)
This command removes all triggers for programs called before trigger events from the physical file named EMP.
Example 3: Removing a Trigger for a Program Called After an Insert Event
RMVPFTRG FILE(EMP) TRGTIME(*AFTER) TRGEVENT(*INSERT)
This command removes the trigger for the program called after an insert operation from the physical file named EMP.
Top |
Top |