The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT 'Y'
INTO l_secondary_ledger
FROM gl_ledgers gle
WHERE ledger_category_code = 'SECONDARY'
and ledger_id = p_ledger_id
AND currency_code <>
(SELECT currency_code
FROM gl_ledgers
WHERE ledger_id =
(SELECT primary_ledger_id
FROM gl_ledger_relationships
WHERE target_ledger_id = gle.ledger_id
AND relationship_type_code = 'SUBLEDGER' and rownum < 2));
select secondary_exists
into l_deprn_run_id
from (
select 1 secondary_exists
from fa_mc_deprn_summary
where book_type_code = p_source_id_char_1
and asset_id = p_source_id_int_1
and period_counter = p_source_id_int_2
and deprn_run_id = p_source_id_int_3
union
select 2 secondary_exists
from fa_mc_deprn_summary_h
where book_type_code = p_source_id_char_1
and asset_id = p_source_id_int_1
and period_counter = p_source_id_int_2
and deprn_run_id = p_source_id_int_3
)
where rownum < 2;