Skip to content

Instantly share code, notes, and snippets.

@VikramVasudevan
Created January 1, 2020 07:43
Show Gist options
  • Save VikramVasudevan/b3d8f2304c3e2a227ca45e4368c73566 to your computer and use it in GitHub Desktop.
Save VikramVasudevan/b3d8f2304c3e2a227ca45e4368c73566 to your computer and use it in GitHub Desktop.
table_agg_stg
AS (SELECT trigger_sql,
table_name,
listagg (
'audtab.' || column_name || ':= :NEW.' || column_name,
'; ')
WITHIN GROUP (ORDER BY column_id)
insert_column_list,
listagg (
'audtab.' || column_name || ':= :OLD.' || column_name,
'; ')
WITHIN GROUP (ORDER BY column_id)
update_column_list
FROM table_columns_stg
GROUP BY trigger_sql, table_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment