The following lines contain the word 'select', 'insert', 'update' or 'delete':
select count(*) into critical_n from fnd_log_unique_exceptions where
severity='CRITICAL' and status='N';
select count(*) into error_n from fnd_log_unique_exceptions where
severity='ERROR' and status='N';
select count(*) into warning_n from fnd_log_unique_exceptions where
severity='WARNING' and status='N';
select count(*) into critical_o from fnd_log_unique_exceptions where
severity='CRITICAL' and status='O';
select count(*) into error_o from fnd_log_unique_exceptions where
severity='ERROR' and status='O';
select count(*) into warning_o from fnd_log_unique_exceptions where
severity='WARNING' and status='O';
select count(*) into critical_c from fnd_log_unique_exceptions where
severity='CRITICAL' and status='C';
select count(*) into error_c from fnd_log_unique_exceptions where
severity='ERROR' and status='C';
select count(*) into warning_c from fnd_log_unique_exceptions where
severity='WARNING' and status='C';
select count(*) into critical_n from fnd_log_unique_exceptions where
severity='CRITICAL' and status='N' and category=p_category;
select count(*) into error_n from fnd_log_unique_exceptions where
severity='ERROR' and status='N' and category=p_category;
select count(*) into warning_n from fnd_log_unique_exceptions where
severity='WARNING' and status='N' and category=p_category;
select count(*) into critical_o from fnd_log_unique_exceptions where
severity='CRITICAL' and status='O' and category=p_category;
select count(*) into error_o from fnd_log_unique_exceptions where
severity='ERROR' and status='O' and category=p_category;
select count(*) into warning_o from fnd_log_unique_exceptions where
severity='WARNING' and status='O' and category=p_category;
select count(*) into critical_c from fnd_log_unique_exceptions where
severity='CRITICAL' and status='C' and category=p_category;
select count(*) into error_c from fnd_log_unique_exceptions where
severity='ERROR' and status='C' and category=p_category;
select count(*) into warning_c from fnd_log_unique_exceptions where
severity='WARNING' and status='C' and category=p_category;
select sum(count) into critical_n
from fnd_log_unique_exceptions flue
where flue.severity = 'CRITICAL' and flue.status='N';
select sum(count) into error_n
from fnd_log_unique_exceptions flue
where flue.severity = 'ERROR' and flue.status='N';
select sum(count) into warning_n
from fnd_log_unique_exceptions flue
where flue.severity = 'WARNING' and flue.status='N';
select sum(count) into critical_o
from fnd_log_unique_exceptions flue
where flue.severity = 'CRITICAL' and flue.status='O';
select sum(count) into error_o
from fnd_log_unique_exceptions flue
where flue.severity = 'ERROR' and flue.status='O';
select sum(count) into warning_o
from fnd_log_unique_exceptions flue
where flue.severity = 'WARNING' and flue.status='O';
select sum(count) into critical_c
from fnd_log_unique_exceptions flue
where flue.severity = 'CRITICAL' and flue.status='C';
select sum(count) into error_c
from fnd_log_unique_exceptions flue
where flue.severity = 'ERROR' and flue.status='C';
select sum(count) into warning_c
from fnd_log_unique_exceptions flue
where flue.severity = 'WARNING' and flue.status='C';
select sum(count) into critical_n
from fnd_log_unique_exceptions flue
where flue.severity = 'CRITICAL' and flue.status='N'
and flue.category = p_category;
select sum(count) into error_n
from fnd_log_unique_exceptions flue
where flue.severity = 'ERROR' and flue.status='N'
and flue.category = p_category;
select sum(count) into warning_n
from fnd_log_unique_exceptions flue
where flue.severity = 'WARNING' and flue.status='N'
and flue.category = p_category;
select sum(count) into critical_o
from fnd_log_unique_exceptions flue
where flue.severity = 'CRITICAL' and flue.status='O'
and flue.category = p_category;
select sum(count) into error_o
from fnd_log_unique_exceptions flue
where flue.severity = 'ERROR' and flue.status='O'
and flue.category = p_category;
select sum(count) into warning_o
from fnd_log_unique_exceptions flue
where flue.severity = 'WARNING' and flue.status='O'
and flue.category = p_category;
select sum(count) into critical_c
from fnd_log_unique_exceptions flue
where flue.severity = 'CRITICAL' and flue.status='C'
and flue.category = p_category;
select sum(count) into error_c
from fnd_log_unique_exceptions flue
where flue.severity = 'ERROR' and flue.status='C'
and flue.category = p_category;
select sum(count) into warning_c
from fnd_log_unique_exceptions flue
where flue.severity = 'WARNING' and flue.status='C'
and flue.category = p_category;
select user_id into v_userid
from fnd_user where upper(user_name) = upper(p_username);
update fnd_log_unique_exceptions
set status = p_newstate,
last_updated_by = v_userid,
last_update_date = sysdate
where unique_exception_id = to_number(v_curr_id);
select notes into v_notes
from fnd_exception_notes
where unique_exception_id = to_number(v_curr_id)
for update;
insert into fnd_exception_notes (
notes, creation_date, created_by,
last_update_date, last_updated_by,
last_update_login,
log_sequence,
unique_exception_id) values
(v_ack_phrase, sysdate, v_userid, sysdate,
v_userid, 0, -1,
to_number(v_curr_id));