The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
'Y'
from jtf_tasks_b t
where
t.task_id = p_task_id
-- R12 dep/arr
and t.task_type_id = 20;
select
'Y'
from jtf_task_audits_b t
where
t.task_audit_id = p_task_audit_id
-- R12 dep/arr
and ( ( t.old_source_object_type_code = 'TASK' and t.old_task_type_id = 20 ) or
( t.new_source_object_type_code = 'TASK' and t.new_task_type_id = 20 )
);
select enabled
from isc_fs_enable_events;
update isc_fs_enable_events
set enabled = 'Y'
, last_updated_by = fnd_global.user_id
, last_update_date = sysdate
, last_update_login = fnd_global.login_id
, program_id = fnd_global.conc_program_id
, program_login_id = fnd_global.conc_login_id
, program_application_id = fnd_global.prog_appl_id
, request_id = fnd_global.conc_request_id;
insert into
isc_fs_enable_events
( enabled
, created_by
, creation_date
, last_updated_by
, last_update_date
, last_update_login
, program_id
, program_login_id
, program_application_id
, request_id
)
values
( 'Y'
, fnd_global.user_id
, sysdate
, fnd_global.user_id
, sysdate
, fnd_global.login_id
, fnd_global.conc_program_id
, fnd_global.conc_login_id
, fnd_global.prog_appl_id
, fnd_global.conc_request_id
);
insert into isc_fs_events
( send_date
, event_name
, source_object_type_code
, source_object_id
, task_id
, task_audit_id
, created_by
, creation_date
, last_updated_by
, last_update_date
, last_update_login
)
values
( l_send_date
, l_event_name
, l_source_object_type_code
, l_source_object_id
, l_task_id
, l_task_audit_id
, fnd_global.user_id
, sysdate
, fnd_global.user_id
, sysdate
, fnd_global.login_id
);
select
source_object_type_code
, source_object_id
from
jtf_tasks_b
where task_id = b_task_id
and ( source_object_type_code = 'SR' or
( source_object_type_code = 'TASK' and
-- R12 dep/arr
task_type_id = 20
)
);
insert into isc_fs_events
( send_date
, event_name
, source_object_type_code
, source_object_id
, task_id
, task_assignment_id
, created_by
, creation_date
, last_updated_by
, last_update_date
, last_update_login
)
values
( l_send_date
, l_event_name
, l_source_object_type_code
, l_source_object_id
, l_task_id
, l_task_assignment_id
, fnd_global.user_id
, sysdate
, fnd_global.user_id
, sysdate
, fnd_global.login_id
);
select
i.incident_id
from
jtf_tasks_b t
, cs_incidents_all_b i
where
t.source_object_type_code = 'SR'
and t.source_object_id = i.incident_id
and i.incident_number = b_incident_number;
insert into isc_fs_events
( send_date
, event_name
, source_object_type_code
, source_object_id
, task_id
, created_by
, creation_date
, last_updated_by
, last_update_date
, last_update_login
)
select
l_send_date
, l_event_name
, t.source_object_type_code
, t.source_object_id
, t.task_id
, fnd_global.user_id
, sysdate
, fnd_global.user_id
, sysdate
, fnd_global.login_id
from
cs_incidents_audit_b a
, jtf_tasks_b t
where
a.incident_id = l_incident_id
and a.creation_date >= l_send_date - (5/1440) -- include audits from 5 minutes before event sent date
and 'Y' in ( a.change_inventory_item_flag
, a.change_inv_organization_flag
)
and a.entity_activity_code = 'U'
and a.updated_entity_code = 'SR_HEADER'
and t.source_object_type_code = 'SR'
and t.source_object_id = a.incident_id;