The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
action_id
,language
,source_lang
,description
from ame_actions_tl
where action_id = p_action_id
and language = p_language;
select
action_id
,language
,source_lang
,description
from ame_actions_tl
where action_id = p_action_id
and language = p_language
for update nowait;
delete from AME_ACTIONS_TL T
where not exists
(select NULL
from AME_ACTIONS B
where B.ACTION_ID = T.ACTION_ID
);
update AME_ACTIONS_TL T set (
DESCRIPTION
) = (select
B.DESCRIPTION
from AME_ACTIONS_TL B
where B.ACTION_ID = T.ACTION_ID
and B.LANGUAGE = T.SOURCE_LANG)
where (
T.ACTION_ID,
T.LANGUAGE
) in (select
SUBT.ACTION_ID,
SUBT.LANGUAGE
from AME_ACTIONS_TL SUBB, AME_ACTIONS_TL SUBT
where SUBB.ACTION_ID = SUBT.ACTION_ID
and SUBB.LANGUAGE = SUBT.SOURCE_LANG
and (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 AME_ACTIONS_TL (
ACTION_ID,
DESCRIPTION,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN,
LANGUAGE,
SOURCE_LANG
) select /*+ ORDERED */
B.ACTION_ID,
B.DESCRIPTION,
B.CREATED_BY,
B.CREATION_DATE,
B.LAST_UPDATED_BY,
B.LAST_UPDATE_DATE,
B.LAST_UPDATE_LOGIN,
L.LANGUAGE_CODE,
B.SOURCE_LANG
from AME_ACTIONS_TL B, FND_LANGUAGES L
where L.INSTALLED_FLAG in ('I', 'B')
and B.LANGUAGE = userenv('LANG')
and not exists
(select NULL
from AME_ACTIONS_TL T
where T.ACTION_ID = B.ACTION_ID
and T.LANGUAGE = L.LANGUAGE_CODE);