Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
titleTruncate Data Location Tables
select 'truncate table MY_SCHEMA.' || table_name || ';' as generated_statements
from all_tables 
where
  owner = 'MY_SCHEMA'               /* set this to your data location schema */
  and table_name not like 'DL_%'    /* do not truncate these system tables   */
  and table_name not like 'EXT_%'   /* do not truncate these system tables   */
  and table_name like '%STORE%ENTITYNAME'     /* edit these filters as needed          */
order by substr(table_name,3), table_name;

...

Code Block
languagesql
titleTruncate Data Location Tables for Postgres
select 'truncate table my_schema.' || tablename || ';' as generated_statements
from pg_catalog.pg_tables 
where schemaname = 'my_schema'      /* set this to your data location schema */
  and tablename not like 'dl_%'     /* do not truncate these system tables   */
  and tablename not like 'ext_%'    /* do not truncate these system tables   */
  and tablename likeilike '%ENTITYNAME%entityname' /* edit these filters as needed          */
order by substr(tablename,3), tablename;

...