The following lines contain the word 'select', 'insert', 'update' or 'delete':
select substr(replace(substr(upper(fpovl.sql_validation),instr(upper(fpovl.sql_validation),'SELECT',1,1)-1,
instr(upper(fpovl.sql_validation),'COLUMN',1,1) -
instr(upper(fpovl.sql_validation),'SELECT',1,1)),'\',''),2,
(length(replace(substr(upper(fpovl.sql_validation),instr(upper(fpovl.sql_validation),'SELECT',1,1)-1,
instr(upper(fpovl.sql_validation),'COLUMN',1,1) -
instr(upper(fpovl.sql_validation),'SELECT',1,1)),'\','')) -2 ))SQL_VALID,
fpov.profile_option_value PROF_VAL
from fnd_profile_options_vl fpovl,
fnd_profile_option_values fpov
where fpovl.profile_option_id IN (
select profile_option_id
from fnd_profile_options_vl
where application_id = 515)
and fpov.profile_option_id = fpovl.profile_option_id
and fpovl.USER_VISIBLE_FLAG = 'Y'
and fpov.profile_option_id = p_profile_option_id
and fpov.level_id = p_level_id
order by fpovl.profile_option_id,fpov.level_id,fpov.level_value;
select instr(v_sql_valid,'INTO') into v_into_loc from dual;
select instr(v_sql_valid,':VISIBLE_OPTION_VALUE') into v_visoval_loc from dual;
select instr(v_sql_valid,':PROFILE_OPTION_VALUE') into v_profoval_loc from dual;
select instr(v_sql_valid,'WHERE',-1,1) into v_whr_loc from dual;
select instr(v_sql_valid,'FROM',1,1) into v_from_loc from dual;
select instr(v_sql_valid,'ORDER',1,1) into v_orderby_loc from dual;