The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 1
from pay_user_rows_f b
where b.user_row_id = p_user_row_id
and not exists
-- this is the first insert ; there is no corresponding row in tl table
( select 1
from pay_user_rows_f_tl tl
where tl.user_row_id = p_user_row_id ) ;
l_pur.delete;
l_pur.delete;
select 1
from pay_user_rows_f_tl p
where p.user_row_id = p_user_row_id
and not exists
( select 1
from pay_user_rows_f p1
where p1.user_row_id = p_user_row_id
);
l_pur_del.delete;
l_pur_del.delete;
select 1
from pay_balance_categories_f b
where b.balance_category_id = p_balance_category_id
and not exists
-- this is the first insert ; there is no corresponding row in tl table
( select 1
from pay_balance_categories_f_tl tl
where tl.balance_category_id = p_balance_category_id ) ;
l_pbc.delete;
l_pbc.delete;
select 1
from pay_balance_categories_f_tl p
where p.balance_category_id = p_balance_category_id
and not exists
( select 1
from pay_balance_categories_f p1
where p1.balance_category_id = p_balance_category_id
);
l_pbc_del.delete;
l_pbc_del.delete;
select 1
from ff_globals_f b
where b.global_id = p_global_id
and not exists
-- this is the first insert; there is no corresponding row in tl table
( select 1
from ff_globals_f_tl tl
where tl.global_id = p_global_id ) ;
l_glb.delete ;
l_glb.delete;
select 1
from ff_globals_f_tl f
where f.global_id = p_global_id
and not exists
( select 1
from ff_globals_f f1
where f1.global_id = p_global_id
);
l_glb_del.delete;
l_glb_del.delete;
select 1
from ff_formulas_f b
where b.formula_id = p_formula_id
and not exists
-- this is the first insert ; there is no corresponding row in tl table
( select 1
from ff_formulas_f_tl tl
where tl.formula_id = p_formula_id ) ;
l_fml.delete;
l_fml.delete;
select 1
from ff_formulas_f_tl f
where f.formula_id = p_formula_id
and not exists
( select 1
from ff_formulas_f f1
where f1.formula_id = p_formula_id
);
l_fml_del.delete;
l_fml_del.delete;