The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
booking_justification_id
,justification_text
,source_lang
,language
from ota_bkng_justifications_tl
where booking_justification_id = p_booking_justification_id
and language = p_language;
select
booking_justification_id
,justification_text
,source_lang
,language
from ota_bkng_justifications_tl
where booking_justification_id = p_booking_justification_id
and language = p_language
for update nowait;
delete from OTA_BKNG_JUSTIFICATIONS_TL T
where not exists
(select NULL
from OTA_BKNG_JUSTIFICATIONS_B B
where B.BOOKING_JUSTIFICATION_ID = T.BOOKING_JUSTIFICATION_ID
);
update OTA_BKNG_JUSTIFICATIONS_TL T set (
JUSTIFICATION_TEXT
) = (select
B.JUSTIFICATION_TEXT
from OTA_BKNG_JUSTIFICATIONS_TL B
where B.BOOKING_JUSTIFICATION_ID = T.BOOKING_JUSTIFICATION_ID
and B.LANGUAGE = T.SOURCE_LANG)
where (
T.BOOKING_JUSTIFICATION_ID,
T.LANGUAGE
) in (select
SUBT.BOOKING_JUSTIFICATION_ID,
SUBT.LANGUAGE
from OTA_BKNG_JUSTIFICATIONS_TL SUBB, OTA_BKNG_JUSTIFICATIONS_TL SUBT
where SUBB.BOOKING_JUSTIFICATION_ID = SUBT.BOOKING_JUSTIFICATION_ID
and SUBB.LANGUAGE = SUBT.SOURCE_LANG
and (SUBB.JUSTIFICATION_TEXT <> SUBT.JUSTIFICATION_TEXT
));
insert into OTA_BKNG_JUSTIFICATIONS_TL (
BOOKING_JUSTIFICATION_ID,
JUSTIFICATION_TEXT,
CREATED_BY,
CREATION_DATE,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
LANGUAGE,
SOURCE_LANG
) select /*+ ORDERED */
B.BOOKING_JUSTIFICATION_ID,
B.JUSTIFICATION_TEXT,
B.CREATED_BY,
B.CREATION_DATE,
B.LAST_UPDATE_DATE,
B.LAST_UPDATED_BY,
B.LAST_UPDATE_LOGIN,
L.LANGUAGE_CODE,
B.SOURCE_LANG
from OTA_BKNG_JUSTIFICATIONS_TL B, FND_LANGUAGES L
where L.INSTALLED_FLAG in ('I', 'B')
and B.LANGUAGE = userenv('LANG')
and not exists
(select NULL
from OTA_BKNG_JUSTIFICATIONS_TL T
where T.BOOKING_JUSTIFICATION_ID = B.BOOKING_JUSTIFICATION_ID
and T.LANGUAGE = L.LANGUAGE_CODE);