A trigger program is a program that contains a set of trigger actions. A trigger action is a set of actions (high-level language statements, SQL statements, or AS/400 utilities) that are performed automatically when a specified change operation (trigger event) occurs on a specified table or file. For more information on triggers and trigger programs, see the Triggers section of the Database Programming book.
If records are copied to a physical file that has an *INSERT trigger program associated with it, the trigger program is called each time a record is copied to the file. The trigger program is not called if deleted records are copied. If an error occurs while the trigger program is running, the copy operation fails. However, records that were successfully copied before the error occurred remain in the to-file.
If a from-file has a trigger program associated with it, the CPYF and CPYFRMQRYF commands do not copy the trigger information to the to-file when the CRTFILE parameter is used.