- 17.9K All Categories
- 3.3K Industry Applications
- 3.2K Intelligent Advisor
- 59 Insurance
- 534.1K On-Premises Infrastructure
- 137.6K Analytics Software
- 38.5K Application Development Software
- 5.3K Cloud Platform
- 109.1K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 70.8K Infrastructure Software
- 105.1K Integration
- 41.5K Security Software
Triggers: treat :old and :new as ROWTYPE
It has been recommended to move trigger code to stored procedures when the code gets large. We would hence create a procedure (stand-alone or inside a package) as
PROCEDURE p_handle_mytable (vi_old mytable%ROWTYPE, vi_new mytable%ROWTYPE) AS ...
Unfortunately, though, we cannot simply
CREATE OR REPLACE TRIGGER trg_mytable AFTER DELETE OR INSERT OR UPDATE ON mytable FOR EACH ROW BEGIN p_handle_mytable (:old, :new); END;
although this is PL/SQL code and :old and :new seem to work exactly as if defined as mytable%rowtype elsewise.
My request: Treat :old and :new as ROWTYPE and make it thus possible to pass :old and :new to a procedure.
(Sorry, if this idea has been suggested before. I've not been able to properly search database ideas in the new forum. Hence I do not know whether this idea has already been proposed.)