The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
table_route_id
,display_name
,language
,source_lang
from pqh_table_route_tl
where table_route_id = p_table_route_id
and language = p_language;
select
table_route_id
,display_name
,language
,source_lang
from pqh_table_route_tl
where table_route_id = p_table_route_id
and language = p_language
for update nowait;
delete from PQH_TABLE_ROUTE_TL T
where not exists
(select NULL
from PQH_TABLE_ROUTE B
where B.TABLE_ROUTE_ID = T.TABLE_ROUTE_ID
);
update PQH_TABLE_ROUTE_TL T set (
DISPLAY_NAME
) = (select
B.DISPLAY_NAME
from PQH_TABLE_ROUTE_TL B
where B.TABLE_ROUTE_ID = T.TABLE_ROUTE_ID
and B.LANGUAGE = T.SOURCE_LANG)
where (
T.TABLE_ROUTE_ID,
T.LANGUAGE
) in (select
SUBT.TABLE_ROUTE_ID,
SUBT.LANGUAGE
from PQH_TABLE_ROUTE_TL SUBB, PQH_TABLE_ROUTE_TL SUBT
where SUBB.TABLE_ROUTE_ID = SUBT.TABLE_ROUTE_ID
and SUBB.LANGUAGE = SUBT.SOURCE_LANG
and (SUBB.DISPLAY_NAME <> SUBT.DISPLAY_NAME
or (SUBB.DISPLAY_NAME is null and SUBT.DISPLAY_NAME is not null)
or (SUBB.DISPLAY_NAME is not null and SUBT.DISPLAY_NAME is null)
));
insert into PQH_TABLE_ROUTE_TL (
TABLE_ROUTE_ID,
DISPLAY_NAME,
LAST_UPDATE_DATE,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
LAST_UPDATED_BY,
LANGUAGE,
SOURCE_LANG
) select
B.TABLE_ROUTE_ID,
B.DISPLAY_NAME,
B.LAST_UPDATE_DATE,
B.CREATION_DATE,
B.CREATED_BY,
B.LAST_UPDATE_LOGIN,
B.LAST_UPDATED_BY,
L.LANGUAGE_CODE,
B.SOURCE_LANG
from PQH_TABLE_ROUTE_TL B, FND_LANGUAGES L
where L.INSTALLED_FLAG in ('I', 'B')
and B.LANGUAGE = userenv('LANG')
and not exists
(select NULL
from PQH_TABLE_ROUTE_TL T
where T.TABLE_ROUTE_ID = B.TABLE_ROUTE_ID
and T.LANGUAGE = L.LANGUAGE_CODE);