The following lines contain the word 'select', 'insert', 'update' or 'delete':
select wdj.scheduled_start_date,
wdj.scheduled_completion_date
into l_startDate, l_endDate
from wip_discrete_jobs wdj
where wdj.organization_id = p_orgID
and wdj.wip_entity_id = p_wipEntityID;
update wip_requirement_operations wro
set wro.date_required = (select nvl(max(wo.first_unit_start_date),l_startDate)
from wip_operations wo
where wo.organization_id = wro.organization_id
and wo.wip_entity_id = wro.wip_entity_id
and wo.operation_seq_num = abs(wro.operation_seq_num))
where wro.wip_entity_id = p_wipEntityID
and wro.organization_id = p_orgID;
delete wip_operation_resource_usage
where wip_entity_id = p_wipEntityID;
wip_op_resources_utilities.update_resource_instances(
p_wip_entity_id => p_wipEntityID,
p_org_id => p_orgID);
select inventory_item_id,
-1*operation_seq_num operation_seq_num
from wip_requirement_operations
where organization_id = p_orgID
and wip_entity_id = p_wipEntityID
and operation_seq_num < 0
and wip_supply_type = wip_constants.phantom;
select job_type,
status_type,
primary_item_id,
bom_reference_id,
routing_reference_id,
bom_revision,/*add for bug 15963294*/
routing_revision,/*add for bug 15963294*/
bom_revision_date,
routing_revision_date,
alternate_bom_designator,
alternate_routing_designator,
scheduled_start_date, /*Bug 12580949*/
scheduled_completion_date /*Bug 12580949*/
into l_jobType,
l_jobStatus,
l_assemblyID,
l_bomRefID,
l_rtgRefID,
l_bomRev, /*add for bug 15963294*/
l_rtgRev, /*add for bug 15963294*/
l_bomRevDate,
l_rtgRevDate,
l_altBom,
l_altRtg,
l_jobstartDate, /*Bug 12580949*/
l_jobCompDate /*Bug 12580949*/
from wip_discrete_jobs
where organization_id = p_orgID
and wip_entity_id = p_wipEntityID;
wip_update_setup_resources.delete_setup_resources_pub(
p_wip_entity_id => p_wipEntityID,
p_organization_id => p_orgID);
delete from wip_operations
where wip_entity_id = p_wipEntityID
and organization_id = p_orgID;
delete from wip_operation_resources
where wip_entity_id = p_wipEntityID
and organization_id = p_orgID;
delete from wip_sub_operation_resources
where wip_entity_id = p_wipEntityID
and organization_id = p_orgID;
fnd_attached_documents2_pkg.delete_attachments(
x_entity_name => 'WIP_DISCRETE_OPERATIONS',
x_pk1_value => to_char(p_wipEntityID),
x_pk3_value => to_char(p_orgID),
x_delete_document_flag => 'Y');
wip_update_setup_resources.delete_setup_resources_pub(
p_wip_entity_id => p_wipEntityID,
p_organization_id => p_orgID);
delete from wip_operations
where wip_entity_id = p_wipEntityID
and organization_id = p_orgID;
delete from wip_operation_resources
where wip_entity_id = p_wipEntityID
and organization_id = p_orgID;
delete from wip_sub_operation_resources
where wip_entity_id = p_wipEntityID
and organization_id = p_orgID;
fnd_attached_documents2_pkg.delete_attachments(
x_entity_name => 'WIP_DISCRETE_OPERATIONS',
x_pk1_value => to_char(p_wipEntityID),
x_pk3_value => to_char(p_orgID),
x_delete_document_flag => 'Y');
select wdj.scheduled_start_date,
wdj.scheduled_completion_date
into l_startDate, l_endDate
from wip_discrete_jobs wdj
where wdj.organization_id = p_orgID
and wdj.wip_entity_id = p_wipEntityID;
select 1 into l_bill_present
from dual
where exists (select 1 from bom_structures_b
where pk1_value = l_bomItemID
and pk2_value = p_orgID
and nvl(ALTERNATE_BOM_DESIGNATOR, '$$$$') = nvl(l_altBom,'$$$$')
and obj_name is null
and rownum =1);
delete from wip_requirement_operations
where wip_entity_id = p_wipEntityID
and organization_id = p_orgID;
select wdj.scheduled_start_date
into l_startDate
from wip_discrete_jobs wdj
where wdj.organization_id = p_orgID
and wdj.wip_entity_id = p_wipEntityID;
delete from WIP_OPERATION_RESOURCES
where wip_entity_id = p_wipEntityID
and organization_id = p_orgID
and phantom_flag = 1;
-- Other wise user not able to update the quantity of the components by preserving the additional components to the job that are not part of the bill.
-- if p_allowExplosion then
wip_bomRoutingUtil_pvt.adjustQtyChange(
p_orgID => p_orgID,
p_wipEntityID => p_wipEntityID,
p_qty => p_qty,
x_returnStatus => x_returnStatus,
x_errorMsg => x_errorMsg);
update wip_requirement_operations wro
set wro.date_required = (select nvl(max(wo.first_unit_start_date),l_startDate)
from wip_operations wo
where wo.organization_id = wro.organization_id
and wo.wip_entity_id = wro.wip_entity_id
and wo.operation_seq_num = abs(wro.operation_seq_num))
where wro.wip_entity_id = p_wipEntityID
and wro.organization_id = p_orgID;
/*Bug 12580949 when scheduling method is manual, and start date and end date populated in WJSI is exactly the same as job start date and completion date, we should not update any date
at operation and resource level*/
elsif(p_schedulingMethod <> wip_constants.ml_manual or l_jobstartDate <> NVL(p_startDate, l_jobstartDate + 1) or l_jobCompDate <> NVL(p_endDate, l_jobCompDate + 1)) then
-- Added for Bug 8463132.
if ( p_schedulingMethod = wip_constants.leadtime ) then
select wdj.scheduled_start_date
into l_startDate
from wip_discrete_jobs wdj
where wdj.organization_id = p_orgID
and wdj.wip_entity_id = p_wipEntityID;
update wip_operations
set first_unit_start_date = p_startDate,
first_unit_completion_date = p_startDate,
last_unit_start_date = p_startDate,
last_unit_completion_date = p_startDate
where organization_id = p_orgID
and wip_entity_id = p_wipEntityID;
update wip_operation_resources
set start_date = p_startDate,
completion_date = p_startDate
where organization_id = p_orgID
and wip_entity_id = p_wipEntityID;
update wip_sub_operation_resources
set start_date = p_startDate,
completion_date = p_startDate
where organization_id = p_orgID
and wip_entity_id = p_wipEntityID;
update wip_requirement_operations wro
set wro.date_required = (select nvl(max(wo.first_unit_start_date),l_startDate)
from wip_operations wo
where wo.organization_id = wro.organization_id
and wo.wip_entity_id = wro.wip_entity_id
and wo.operation_seq_num = abs(wro.operation_seq_num))
where wro.wip_entity_id = p_wipEntityID
and wro.organization_id = p_orgID;
delete wip_operation_resource_usage
where wip_entity_id = p_wipEntityID;
wip_op_resources_utilities.update_resource_instances(
p_wip_entity_id => p_wipEntityID,
p_org_id => p_orgID);