The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
option_type_id
,option_name
,language
,source_lang
from hr_ki_option_types_tl
where
option_type_id = p_option_type_id
and language = p_language;
select
option_type_id
,option_name
,language
,source_lang
from hr_ki_option_types_tl
where
option_type_id = p_option_type_id and language = p_language
for update nowait;
delete from HR_KI_OPTION_TYPES_TL T
where not exists
(select NULL
from HR_KI_OPTION_TYPES B
where B.OPTION_TYPE_ID = T.OPTION_TYPE_ID
);
update HR_KI_OPTION_TYPES_TL T set (
OPTION_NAME
) = (select
B.OPTION_NAME
from HR_KI_OPTION_TYPES_TL B
where B.OPTION_TYPE_ID = T.OPTION_TYPE_ID
and B.LANGUAGE = T.SOURCE_LANG)
where (
T.OPTION_TYPE_ID,
T.LANGUAGE
) in (select
SUBT.OPTION_TYPE_ID,
SUBT.LANGUAGE
from HR_KI_OPTION_TYPES_TL SUBB, HR_KI_OPTION_TYPES_TL SUBT
where SUBB.OPTION_TYPE_ID = SUBT.OPTION_TYPE_ID
and SUBB.LANGUAGE = SUBT.SOURCE_LANG
and (SUBB.OPTION_NAME <> SUBT.OPTION_NAME
));
insert into HR_KI_OPTION_TYPES_TL (
OPTION_TYPE_ID,
OPTION_NAME,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
CREATED_BY,
CREATION_DATE,
LANGUAGE,
SOURCE_LANG
) select /*+ ORDERED */
B.OPTION_TYPE_ID,
B.OPTION_NAME,
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 HR_KI_OPTION_TYPES_TL B, FND_LANGUAGES L
where L.INSTALLED_FLAG in ('I', 'B')
and B.LANGUAGE = userenv('LANG')
and not exists
(select NULL
from HR_KI_OPTION_TYPES_TL T
where T.OPTION_TYPE_ID = B.OPTION_TYPE_ID
and T.LANGUAGE = L.LANGUAGE_CODE);