External Procedures are user-written programs (written using LE-conforming Assembler, COBOL, PL/I, or C) which execute inside the Multi-User Facility as a separate subtask. They can be coded to perform almost any task and generally contain SQL statements. SQL procedures consist of user-written program logic composed of SQL statements and contained entirely within the CREATE PROCEDURE statement. Both types can be executed explicitly using CALL or EXECUTE PROCEDURE statements and can be triggered implicitly by user-specified database management system events such as INSERT, UPDATE, and DELETE. For information specific to each procedure type, see CREATE PROCEDURE.
Triggers depend completely on the SQL procedure to perform the various "triggered" activities. Triggers themselves have a relatively limited logic implementation. A trigger is set to be "fired" when an insert, delete, or update of a row in the selected table occurs. The trigger is fired regardless of where (CICS, batch, Server, and so on) or how (record-at-a-time, set-at-a-time, SQL) the maintenance command was issued. The trigger is not fired when a read (or read for update command) is processed.
Each trigger can be tailored to fire only when specific data values exist. The trigger can also select whether it should fire before or after the event occurs. Selecting "before" gives you the chance to review the process before the maintenance has occurred, while "after" allows you to Trigger the event after the maintenance has occurred.
|
Copyright © 2014 CA.
All rights reserved.
|
|