The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
balance_dimension_id
,language
,source_lang
,dimension_name
,database_item_suffix
,description
from pay_balance_dimensions_tl
where balance_dimension_id = p_balance_dimension_id
and language = p_language;
select
balance_dimension_id
,language
,source_lang
,dimension_name
,database_item_suffix
,description
from pay_balance_dimensions_tl
where balance_dimension_id = p_balance_dimension_id
and language = p_language
for update nowait;
delete from PAY_BALANCE_DIMENSIONS_TL T
where not exists
(select NULL
from PAY_BALANCE_DIMENSIONS B
where B.BALANCE_DIMENSION_ID = T.BALANCE_DIMENSION_ID
);
update PAY_BALANCE_DIMENSIONS_TL T set (
DIMENSION_NAME,
DESCRIPTION
) = (select
B.DIMENSION_NAME,
B.DESCRIPTION
from PAY_BALANCE_DIMENSIONS_TL B
where B.BALANCE_DIMENSION_ID = T.BALANCE_DIMENSION_ID
and B.LANGUAGE = T.SOURCE_LANG)
where (
T.BALANCE_DIMENSION_ID,
T.LANGUAGE
) in (select
SUBT.BALANCE_DIMENSION_ID,
SUBT.LANGUAGE
from PAY_BALANCE_DIMENSIONS_TL SUBB, PAY_BALANCE_DIMENSIONS_TL SUBT
where SUBB.BALANCE_DIMENSION_ID = SUBT.BALANCE_DIMENSION_ID
and SUBB.LANGUAGE = SUBT.SOURCE_LANG
and (SUBB.DIMENSION_NAME <> SUBT.DIMENSION_NAME
or SUBB.DESCRIPTION <> SUBT.DESCRIPTION
or (SUBB.DESCRIPTION is null and SUBT.DESCRIPTION is not null)
or (SUBB.DESCRIPTION is not null and SUBT.DESCRIPTION is null)
));
insert into PAY_BALANCE_DIMENSIONS_TL (
BALANCE_DIMENSION_ID,
DIMENSION_NAME,
DATABASE_ITEM_SUFFIX,
DESCRIPTION,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
CREATED_BY,
CREATION_DATE,
LANGUAGE,
SOURCE_LANG
) select
B.BALANCE_DIMENSION_ID,
B.DIMENSION_NAME,
B.DATABASE_ITEM_SUFFIX,
B.DESCRIPTION,
B.LAST_UPDATE_DATE,
B.LAST_UPDATED_BY,
B.LAST_UPDATE_LOGIN,
B.CREATED_BY,
B.CREATION_DATE,
L.LANGUAGE_CODE,
B.SOURCE_LANG
from PAY_BALANCE_DIMENSIONS_TL B, FND_LANGUAGES L
where L.INSTALLED_FLAG in ('I', 'B')
and B.LANGUAGE = userenv('LANG')
and not exists
(select NULL
from PAY_BALANCE_DIMENSIONS_TL T
where T.BALANCE_DIMENSION_ID = B.BALANCE_DIMENSION_ID
and T.LANGUAGE = L.LANGUAGE_CODE);