The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE Delete_Completed_Records(P_Group_Id IN NUMBER) IS
-- Here, we fetch all requests that were processed successfully
-- or that had a kanban reference. The kanban reference is a special
-- case: we want these rows deleted regardless of whether they
-- were processed correctly.
cursor old_requests is
select rowid, interface_id, header_id
from wip_job_schedule_interface
where
group_id = p_group_id and
((process_phase = WIP_CONSTANTS.ML_COMPLETE and
process_status = WIP_CONSTANTS.ML_COMPLETE) or
(kanban_card_id is not null))
for update ;
delete from wip_interface_errors
where interface_id = old_request.interface_id ;
delete from wip_job_dtls_interface
where group_id = p_group_id
and parent_header_id = old_request.header_id;
delete from wip_job_schedule_interface
where rowid = old_request.rowid ;
END Delete_Completed_Records;
UPDATE WIP_JOB_SCHEDULE_INTERFACE
SET PROCESS_STATUS = WIP_CONSTANTS.ERROR
WHERE GROUP_ID = P_Group_Id
AND PROCESS_PHASE <> WIP_CONSTANTS.ML_COMPLETE;
INSERT INTO WIP_INTERFACE_ERRORS(
interface_id,
error_type,
error,
last_update_date,
creation_date,
created_by,
last_update_login,
last_updated_by)
SELECT interface_id, 1,
Error_Text, sysdate, sysdate,
created_by, last_update_login,
last_updated_by
FROM WIP_JOB_SCHEDULE_INTERFACE
WHERE GROUP_ID = P_Group_Id
AND PROCESS_PHASE <> WIP_CONSTANTS.ML_COMPLETE;