The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
rating_scale_id
,language
,source_lang
,name
,description
from per_rating_scales_tl
where
rating_scale_id = p_rating_scale_id
AND language = p_language;
select
rating_scale_id
,language
,source_lang
,name
,description
from per_rating_scales_tl
where
rating_scale_id = p_rating_scale_id
AND language = p_language
for update nowait;
delete from PER_RATING_SCALES_TL T
where not exists
(select NULL
from PER_RATING_SCALES B
where B.RATING_SCALE_ID = T.RATING_SCALE_ID
);
update PER_RATING_SCALES_TL T set (
NAME,
DESCRIPTION
) = (select
B.NAME,
B.DESCRIPTION
from PER_RATING_SCALES_TL B
where B.RATING_SCALE_ID = T.RATING_SCALE_ID
and B.LANGUAGE = T.SOURCE_LANG)
where (
T.RATING_SCALE_ID,
T.LANGUAGE
) in (select
SUBT.RATING_SCALE_ID,
SUBT.LANGUAGE
from PER_RATING_SCALES_TL SUBB, PER_RATING_SCALES_TL SUBT
where SUBB.RATING_SCALE_ID = SUBT.RATING_SCALE_ID
and SUBB.LANGUAGE = SUBT.SOURCE_LANG
and (SUBB.NAME <> SUBT.NAME
or (SUBB.NAME is null and SUBT.NAME is not null)
or (SUBB.NAME is not null and SUBT.NAME is null)
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 PER_RATING_SCALES_TL (
RATING_SCALE_ID,
NAME,
DESCRIPTION,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN,
LANGUAGE,
SOURCE_LANG
) select
B.RATING_SCALE_ID,
B.NAME,
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 PER_RATING_SCALES_TL B, FND_LANGUAGES L
where L.INSTALLED_FLAG in ('I', 'B')
and B.LANGUAGE = userenv('LANG')
and not exists
(select NULL
from PER_RATING_SCALES_TL T
where T.RATING_SCALE_ID = B.RATING_SCALE_ID
and T.LANGUAGE = L.LANGUAGE_CODE);