Pass data to an SPL routine
You can pass data to an SPL routine in the argument list
of the EXECUTE PROCEDURE or EXECUTE FUNCTION statement. The EXECUTE
PROCEDURE statement in the following example passes values from the quantity and total_price columns
of the items table to the SPL routine calc_totpr:
CREATE TRIGGER upd_totpr
UPDATE OF quantity ON items
REFERENCING OLD AS pre_upd NEW AS post_upd
FOR EACH ROW(EXECUTE PROCEDURE calc_totpr(pre_upd.quantity,
post_upd.quantity, pre_upd.total_price) INTO total_price);
Passing data to an SPL routine lets you use data values in the operations that the routine performs.