The following lines contain the word 'select', 'insert', 'update' or 'delete':
select ' '||displayed_field||' '
into
c_zero
from ap_lookup_codes
where lookup_code = 'ZERO';
select ' '||lc1.displayed_field||' ',
' '||lc2.displayed_field||' ',
' '||lc3.displayed_field||' ',
' '||lc4.displayed_field,
lc5.description,
lc6.description,
lc7.description,
lc8.description
into c_billion,
c_million,
c_thousand,
c_zero,
billion_lookup,
million_lookup,
thousand_lookup,
units_lookup
from ap_lookup_codes lc1,
ap_lookup_codes lc2,
ap_lookup_codes lc3,
ap_lookup_codes lc4,
ap_lookup_codes lc5,
ap_lookup_codes lc6,
ap_lookup_codes lc7,
ap_lookup_codes lc8
where lc1.lookup_code = 'BILLION'
and lc1.lookup_type = 'NLS TRANSLATION'
and lc2.lookup_code = 'MILLION'
and lc2.lookup_type = 'NLS TRANSLATION'
and lc3.lookup_code = 'THOUSAND'
and lc3.lookup_type = 'NLS TRANSLATION'
and lc4.lookup_code = 'ZERO'
and lc4.lookup_type = 'NLS TRANSLATION'
and lc5.lookup_code = billion_seg
and lc5.lookup_type = 'NUMBERS'
and lc6.lookup_code = million_seg
and lc6.lookup_type = 'NUMBERS'
and lc7.lookup_code = thousand_seg
and lc7.lookup_type = 'NUMBERS'
and lc8.lookup_code = units_seg
and lc8.lookup_type = 'NUMBERS';
select substr(userenv('LANGUAGE'),1,instr(userenv('LANGUAGE'),'_')-1)
into session_language
from dual;