The following lines contain the word 'select', 'insert', 'update' or 'delete':
''Rows inserted into headers: '' || to_char(SQL%ROWCOUNT));
INSERT INTO FA_XLA_EXT_HEADERS_B_GT (
event_id ,
period_close_date ,
reversal_flag ,
transfer_to_gl_flag ,
accounting_date )
SELECT ctlgd.event_id ,
dp.CALENDAR_PERIOD_CLOSE_DATE ,
''Y'' ,
decode(bc.GL_POSTING_ALLOWED_FLAG ,
''YES'', ''Y'',
''N''),
dp.CALENDAR_PERIOD_CLOSE_DATE
FROM xla_events_gt ctlgd,
fa_book_controls bc,
fa_deprn_periods dp,
fa_deprn_events ds
WHERE ctlgd.entity_code = ''DEPRECIATION''
AND ctlgd.event_type_code = ''ROLLBACK_DEPRECIATION''
AND ds.asset_id = ctlgd.source_id_int_1
AND ds.book_type_code = ctlgd.source_id_char_1
AND ds.period_counter = ctlgd.source_id_int_2
AND ds.deprn_run_id = ctlgd.source_id_int_3
AND bc.book_type_code = ctlgd.source_id_char_1
-- AND ds.book_type_code = ctlgd.valuation_method
AND ds.reversal_event_id = ctlgd.event_id
AND dp.book_type_code = ds.book_type_code
AND dp.period_counter = ds.period_counter;