The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT min(operation_seq_num)
INTO l_operation_seq_num
FROM WIP_OPERATIONS
WHERE organization_id = p_organization_id
AND wip_entity_id = p_wip_entity_id
AND nvl(repetitive_schedule_id ,-99)= nvl(p_repetitive_schedule_id,-99) ;
SELECT min(wmt.transaction_date)
INTO l_strt_date
FROM WIP_MOVE_TRANSACTIONS wmt, WIP_MOVE_TXN_ALLOCATIONS wmta
WHERE wmt.organization_id = p_organization_id
AND wmt.wip_entity_id = p_wip_entity_id
AND wmt.transaction_id = wmta.transaction_id
AND wmta.repetitive_schedule_id = p_repetitive_schedule_id
AND wmt.fm_operation_seq_num = p_operation_seq_num ;
SELECT min(wmt.transaction_date)
INTO l_strt_date
FROM WIP_MOVE_TRANSACTIONS wmt, WIP_MOVE_TXN_ALLOCATIONS wmta
WHERE wmt.organization_id = p_organization_id
AND wmt.wip_entity_id = p_wip_entity_id
AND wmt.transaction_id = wmta.transaction_id
AND wmta.repetitive_schedule_id = p_repetitive_schedule_id
AND wmt.to_operation_seq_num = p_operation_seq_num ;
SELECT min(transaction_date)
INTO l_strt_date
FROM WIP_MOVE_TRANSACTIONS
WHERE organization_id = p_organization_id
AND wip_entity_id = p_wip_entity_id
AND fm_operation_seq_num = p_operation_seq_num ;
SELECT min(transaction_date)
INTO l_strt_date
FROM WIP_MOVE_TRANSACTIONS
WHERE organization_id = p_organization_id
AND wip_entity_id = p_wip_entity_id
AND to_operation_seq_num = p_operation_seq_num ;
SELECT max(operation_seq_num)
INTO l_operation_seq_num
FROM WIP_OPERATIONS
WHERE organization_id = p_organization_id
AND wip_entity_id = p_wip_entity_id
AND nvl(repetitive_schedule_id,-99) = nvl(p_repetitive_schedule_id,-99) ;
SELECT max(wmt.transaction_date)
INTO l_cmpl_date
FROM WIP_MOVE_TRANSACTIONS wmt, WIP_MOVE_TXN_ALLOCATIONS wmta
WHERE wmt.organization_id = p_organization_id
AND wmt.wip_entity_id = p_wip_entity_id
AND wmt.transaction_id = wmta.transaction_id
AND wmta.repetitive_schedule_id = p_repetitive_schedule_id
AND wmt.to_operation_seq_num = p_operation_seq_num ;
SELECT max(wmt.transaction_date)
INTO l_cmpl_date
FROM WIP_MOVE_TRANSACTIONS wmt, WIP_MOVE_TXN_ALLOCATIONS wmta
WHERE wmt.organization_id = p_organization_id
AND wmt.wip_entity_id = p_wip_entity_id
AND wmt.transaction_id = wmta.transaction_id
AND wmta.repetitive_schedule_id = p_repetitive_schedule_id
AND wmt.fm_operation_seq_num = p_operation_seq_num ;
SELECT Decode( status_type,12, date_closed, last_update_date)
INTO l_cmpl_date
FROM wip_repetitive_schedules
WHERE status_type IN (4,5,7,12)
AND repetitive_schedule_id = p_repetitive_schedule_id;
SELECT max(wmt.transaction_date)
INTO l_cmpl_date
FROM WIP_MOVE_TRANSACTIONS wmt
WHERE wmt.organization_id = p_organization_id
AND wmt.wip_entity_id = p_wip_entity_id
AND wmt.to_operation_seq_num = p_operation_seq_num ;
SELECT max(wmt.transaction_date)
INTO l_cmpl_date
FROM WIP_MOVE_TRANSACTIONS wmt
WHERE wmt.organization_id = p_organization_id
AND wmt.wip_entity_id = p_wip_entity_id
AND wmt.fm_operation_seq_num = p_operation_seq_num ;
SELECT Decode( status_type,12, date_closed,
4, date_completed,
5, date_completed,
last_update_date)
INTO l_cmpl_date
FROM wip_discrete_jobs
WHERE status_type IN (4,5,7,12)
AND wip_entity_id = p_wip_entity_id;