The following lines contain the word 'select', 'insert', 'update' or 'delete':
select BOR.COMPLETION_SUBINVENTORY
into p_comp_sub
from BOM_OPERATIONAL_ROUTINGS BOR
where BOR.ORGANIZATION_ID = p_org_id
and BOR.ASSEMBLY_ITEM_ID = p_item_id
and NVL(BOR.ALTERNATE_ROUTING_DESIGNATOR,'@@@') =
NVL(p_alt_rtg_des, '@@@');
select BOR.COMPLETION_SUBINVENTORY,
BOR.COMPLETION_LOCATOR_ID
into p_rout_comp_sub,
p_rout_comp_loc
from BOM_OPERATIONAL_ROUTINGS BOR
where BOR.ORGANIZATION_ID = p_org_id
and BOR.ASSEMBLY_ITEM_ID = p_item_id
and NVL(BOR.ALTERNATE_ROUTING_DESIGNATOR,'@@@') =
NVL(p_alt_rtg_des, '@@@') ;
select count(*) into l_success
from mtl_item_locations
where inventory_location_id = p_comp_loc
and organization_id = p_org_id
and subinventory_code = p_comp_sub ;
select count(*) into x_loc_seg_exists
from mtl_transactions_interface
where transaction_interface_id = p_txn_int_id
and ( LOC_SEGMENT1 is not null
or LOC_SEGMENT2 is not null
or LOC_SEGMENT3 is not null
or LOC_SEGMENT4 is not null
or LOC_SEGMENT5 is not null
or LOC_SEGMENT6 is not null
or LOC_SEGMENT7 is not null
or LOC_SEGMENT8 is not null
or LOC_SEGMENT9 is not null
or LOC_SEGMENT10 is not null
or LOC_SEGMENT11 is not null
or LOC_SEGMENT12 is not null
or LOC_SEGMENT13 is not null
or LOC_SEGMENT14 is not null
or LOC_SEGMENT15 is not null
or LOC_SEGMENT16 is not null
or LOC_SEGMENT17 is not null
or LOC_SEGMENT18 is not null
or LOC_SEGMENT19 is not null
or LOC_SEGMENT20 is not null
) ;
select count(*) into x_success
from mtl_item_locations
where inventory_location_id = p_comp_loc
and organization_id = p_org_id
and subinventory_code = p_comp_sub ;
select WIP_JOB_NUMBER_S.nextval into p_sched_num
from dual ;
function Last_Updated_Id(p_last_up_by_name in out NOCOPY varchar2,
p_last_up_id in out NOCOPY number) return number is
x_success number := 0;
select USER_ID
into p_last_up_id
from FND_USER
where USER_NAME = p_last_up_by_name ;
select USER_NAME
into p_last_up_by_name
from FND_USER
where USER_ID = p_last_up_id ;
END Last_Updated_Id;
select USER_ID
into p_created_id
from FND_USER
where USER_NAME = p_created_by_name ;
select USER_NAME
into p_created_by_name
from FND_USER
where USER_ID = p_created_id ;
select ORGANIZATION_ID
into p_org_id
--from ORG_ORGANIZATION_DEFINITIONS
from mtl_parameters
where ORGANIZATION_CODE = p_org_name ;
select ORGANIZATION_CODE
into p_org_name
--from ORG_ORGANIZATION_DEFINITIONS
from mtl_parameters
where ORGANIZATION_ID = p_org_id ;
select wip_entity_id
into p_txn_src_id
from wip_entities we
where we.organization_id = p_org_id
and we.wip_entity_name = p_txn_src_name ;
select wip_entity_name
into p_txn_src_name
from wip_entities we
where we.organization_id = p_org_id
and we.wip_entity_id = p_txn_src_id ;
select
nvl(p_sched_num, schedule_number),
nvl(p_src_proj_id,project_id),
nvl(p_src_task_id,task_id),
nvl(p_proj_id,project_id),
nvl(p_task_id,task_id),
nvl(p_bom_rev,bom_revision),
nvl(p_bom_rev_date,bom_revision_date),
nvl(p_rout_rev,routing_revision),
nvl(p_rout_rev_date,routing_revision_date),
Decode(p_txn_action_id, 30, NULL, nvl(p_comp_sub,completion_subinventory)),-- CFM Scrap
nvl(p_class_code,class_code),
nvl(p_wip_entity_type,4), -- Work Order-less Completions
-- fix bug#956467
Decode(p_txn_action_id, 30, NULL,nvl(p_comp_loc,completion_locator_id)),-- CFM Scrap
nvl(p_alt_rtg_des,alternate_routing_designator),
nvl(p_alt_bom_des,alternate_bom_designator),
scheduled_completion_date
into
p_sched_num,
p_src_proj_id,
p_src_task_id,
p_proj_id,
p_task_id,
p_bom_rev,
p_bom_rev_date,
p_rout_rev,
p_rout_rev_date,
p_comp_sub,
p_class_code,
p_wip_entity_type,
p_comp_loc,
p_alt_rtg_des,
p_alt_bom_des,
x_sched_cmp_date
from
wip_flow_schedules
where
wip_entity_id = p_txn_src_id
and organization_id = p_org_id ;
select null,null /*completion subinventory is inactive */
into p_comp_sub,p_comp_loc
from mtl_secondary_inventories
where organization_id = p_org_id
and secondary_inventory_name = p_comp_sub
and (
NVL(disable_date, TRUNC(p_start_date)+1) <= TRUNC(p_start_date)
OR
/*Bug3784658. Consider material status */
wip_utilities.is_status_applicable(NULL,
p_txn_type_id,
NULL,
NULL,
p_org_id,
p_item_id,
p_comp_sub,
NULL,
NULL,
NULL,
'Z') = 'N');