
SET SERVEROUTPUT ON;
DECLARE
  v_drop_sql VARCHAR2(32767);
BEGIN
  FOR i IN (
    SELECT  
      'DROP TRIGGER DW_REF_MAIN.'||TRIGGER_NAME AS sql_str,
      'DW_REF_MAIN.AUTOKEY_'||TABLE_NAME AS trigger_name
    FROM DBA_TRIGGERS
    WHERE 
        OWNER = 'DW_REF_MAIN' 
    AND TRIGGER_NAME LIKE 'AUTOKEY%'
    AND TABLE_NAME IN (
'ASSET_CODE_TYPE', 'ABS_TYPE', 'ALLOTMENT_METHOD', 'AREA_CODE_RIAD', 'ASSET_GROUP_DETAIL', 'ASSET_GROUP_MAPPING', 'ASSET_GROUP_TMS', 'ASSET_GROUP_TMS_OLD_NEW_MAP', 'ASSET_TYPE', 'ASSET_TYPE_TMS', 
'CAPITAL_KEY', 'COUNTRY', 'CSPP_BENCHMARK', 'CSPP_GROUP_MEMBERS', 'CSPP_GROUPS', 'CURRENCY', 'ELA_COUNTRY_CEILING', 'ELA_FUNDING_GAP', 'ELA_MFI_CEILING', 'ESA_95_INSTR_CLASS_CSDB', 
'ESA_95_SECTOR', 'ESA_2010_INSTR_CLASS_CSDB', 'ESA_2010_ISSUER_CLASS_CSDB', 'ESAST_SUB_SECTOR_RIAD', 'HAIRCUT_CATEGORIES', 'HAIRCUT_SCHEDULE', 'HOLIDAY', 'INSTITUTION_C2D', 'INSTITUTION_CODE_TYPE', 'INSTITUTION_ECONOMIC_ACTIVITY', 
'INSTITUTION_IDENTIFIER_TYPE', 'INSTITUTION_RAT_OUTLOOK_VALUE', 'INSTITUTION_RAT_WATCH_VALUE', 'INSTITUTION_ROLE', 'INSTITUTION_SUBROLE', 'ISSUER_DEBTOR_GUARANTOR_GROUP', 'LIMIT_BREACH_CAUSE', 'LIMIT_TYPE', 'LIMIT_VIOLATION_TYPE', 'MAP_COUPON_FREQ', 
'MAP_COUPON_FREQ_RAR', 'MAP_COUPON_TYPE', 'MAP_COUPON_TYPE_RAR', 'NACE2_INDUSTRY_CLASS_CSDB', 'OPERATION_NAME', 'OPERATION_PROCEDURE', 'OPERATION_PUBLIC', 'OPERATION_TYPE', 'OWN_USE', 'PRICE_TYPE_MAP', 
'PRICE_TYPE_RAR', 'PSE_TYPE', 'QUOT_BASIS_MAP', 'RATING', 'RATING_ACTION', 'RATING_PD', 'RATING_PRIORITY', 'RATING_SOURCE', 'RATING_TYPE', 'REDEMPTION_FREQUENCY_CSDB', 
'REDEMPTION_TYPE_CSDB', 'RIC_CODE_CREATION_RULE', 'TMS_ACTIVITY_GROUPING', 'TMS_POSITION_CONFIG', 'MARKET_COUNTRIES', 'MEASUREMENT_UNITS', 'NCB', 'PORTFOLIO', 'PP_BUCKET', 'PP_CASH_FLOW_TYPE', 
'PP_METHOD', 'PP_PORTF_BNCHMK_MAP', 'SCENARIOS', 'INSTITUTION_ROLE_C2D'
    ) 
    ORDER BY TABLE_NAME
  ) LOOP
    v_drop_sql := i.sql_str;
    
  DBMS_OUTPUT.PUT_LINE(i.trigger_name);
  EXECUTE IMMEDIATE v_drop_sql;

--  DBMS_OUTPUT.PUT_LINE(v_drop_sql||'
--  /
--  ');

END LOOP;

END;
/
