Command reference / db

RMVPFTRG

Remove Physical File Trigger

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.

Allowed environments: *ALL. Positional parameters: 3.

Restrictions

Parameters

FILE File

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.

Type
*QUAL
Required
Yes
Case
Uppercase
Qualifier 1: Physical file: name
Specify the name of the file from which the trigger is to be removed.
Qualifier 2: Library: name
Specify the name of the library to be searched.
*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

File File

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

TRGTIME TRGTIME

Specifies the trigger to be removed, based on the time when the trigger program is called.

Type
*CHAR
Required
No
Default
*ALL
Length
7
Case
Uppercase

Allowed values: *BEFORE, *AFTER, *ALL

*ALL
All triggers for programs called either before or after a trigger event are removed.
*BEFORE
The triggers for programs called before a trigger event are removed.
*AFTER
The triggers for programs called after a trigger event are removed.

TRGEVENT TRGEVENT

Specifies the trigger event for which the associated triggers are removed.

Type
*CHAR
Required
No
Default
*ALL
Length
7
Case
Uppercase

Allowed values: *INSERT, *DELETE, *UPDATE, *READ, *ALL

*ALL
All triggers for insert, delete, and update operations are removed.
*INSERT
The triggers for insert operations are removed.
*DELETE
The triggers for delete operations are removed.
*UPDATE
The triggers for update operations are removed.
*READ
The triggers for read operations are removed.

TRG TRG

Specifies the name of the trigger being removed. The following are examples of the TRG parameter dependencies: TRG(*ALL) TRGTIME(*ALL) TRGEVENT(*ALL) - All triggers are removed. TRG(*ALL) TRGTIME(*INSERT) TRGEVENT(*AFTER) - All *INSERT *AFTER triggers are removed. TRG(ABC) TRGTIME(*ALL) TRGEVENT(*ALL) - The triggers named ABC are removed.

Type
*CHAR
Required
No
Default
*ALL
Length
258
Case
Mixed case

Suggested / special values: *ALL

*ALL
All trigger definitions are removed, including SQL triggers.
character-value
Specify the name of the trigger. You can specify a maximum of 128 characters without delimiters, or 258 characters with quotation mark (") delimiters.

TRGLIB Trigger library

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.

Type
*NAME
Required
No
Default
*FILE
Length
10
Case
Uppercase

Suggested / special values: *FILE, *CURLIB

*FILE
The library for the file specified for the Physical file (FILE) parameter is used.
*CURLIB
The current library for the job is used. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library to be used.

Examples

RMVPFTRG FILE(EMP) TRGEVENT(*INSERT)

Removing All Triggers for Insert Events. This command removes all triggers for programs called by insert operations from the physical file named EMP.

RMVPFTRG FILE(EMP) TRGTIME(*BEFORE)

Removing All Triggers for Programs Called Before a Trigger Event. This command removes all triggers for programs called before trigger events from the physical file named EMP.

IBM command documentation

Generated from os/cl/catalog/RMVPFTRG.json and os/cl/help/RMVPFTRG.json.