Trigger-based CDC - how to build dynamic CREATE TRIGGER statements from user_tab_cols
Here's a head-scratcher: For all tables in a given schema, I need to duplicate each table (DDL) for a trigger-based change capture. For example, DEPT_AUD is created from DEPT using the dbms_metadata function. Standard WHO columns are appended, and a column holding the DDL type (I, U, D).
I can manually map a row-based trigger on DEPT. When updating or inserting or deleting, the table's OLD columns are inserted into DEPT_AUD with the appropriate key. If the DEPT table has n number of columns, the CREATE TRIGGER statement will also require n number of inserted columns (plus the WHO, lest we forget).
0