The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT 'VALID'
INTO l_dummy
FROM bom_bill_alternates_v
WHERE assembly_item_id = l_flow_schedule_rec.primary_item_id
AND organization_id = l_flow_schedule_rec.organization_id
AND alternate_bom_designator =
l_flow_schedule_rec.alternate_bom_designator;
SELECT 'VALID'
INTO l_dummy
FROM bom_routing_alternates_v
WHERE assembly_item_id = l_flow_schedule_rec.primary_item_id
AND organization_id = l_flow_schedule_rec.organization_id
AND NVL(cfm_routing_flag,2) = 2
AND alternate_routing_designator =
l_flow_schedule_rec.alternate_routing_desig;
SELECT 'VALID'
INTO l_dummy
FROM bom_bill_no_hold_revisions_v
WHERE inventory_item_id = l_flow_schedule_rec.primary_item_id
AND organization_id = l_flow_schedule_rec.organization_id
AND revision = l_flow_schedule_rec.bom_revision
AND l_flow_schedule_rec.bom_revision_date >= --fix bug#3170105
effectivity_date;
SELECT 'VALID'
INTO l_dummy
FROM dual
WHERE l_flow_schedule_rec.build_sequence NOT IN
(SELECT build_sequence
FROM wip_flow_schedules
WHERE NVL(schedule_group_id,-1) = NVL(l_schedule_group_id,-1)
AND line_id = l_flow_schedule_rec.line_id
AND scheduled_completion_date --fix bug#3170105
BETWEEN l_flow_schedule_rec.scheduled_completion_date
AND l_flow_schedule_rec.scheduled_completion_date+1-1/(24*60*60)
AND organization_id = l_flow_schedule_rec.organization_id
AND build_sequence = l_flow_schedule_rec.build_sequence);
SELECT 'VALID'
INTO l_dummy
FROM mtl_parameters param,
cst_cg_wip_acct_classes_v ccwac
WHERE ccwac.organization_id = l_flow_schedule_rec.organization_id
AND ccwac.organization_id = param.organization_id
AND ( l_flow_schedule_rec.project_id is null OR
param.primary_cost_method = 1 OR
( param.primary_cost_method = 2 AND
l_flow_schedule_rec.project_id is not null
AND ccwac.cost_group_id =
( SELECT costing_group_id
FROM mrp_project_parameters
WHERE organization_id = l_flow_schedule_rec.organization_id
AND project_id = l_flow_schedule_rec.project_id)))
AND ccwac.class_code = l_flow_schedule_rec.class_code;
SELECT 'VALID'
INTO l_dummy
FROM mtl_item_locations
WHERE organization_id = l_flow_schedule_rec.organization_id
AND subinventory_code = l_flow_schedule_rec.completion_subinventory
AND (disable_date > sysdate or disable_date is null)
AND inventory_location_id =
l_flow_schedule_rec.completion_locator_id;
SELECT 'VALID'
INTO l_dummy
FROM mtl_subinventories_val_v msvv, mtl_sub_ast_trk_val_v msatvv
WHERE msvv.organization_id = l_flow_schedule_rec.organization_id
AND msvv.organization_id = msatvv.organization_id
AND msvv.secondary_inventory_name = msatvv.secondary_inventory_name
AND msvv.secondary_inventory_name =
l_flow_schedule_rec.completion_subinventory;
SELECT 'VALID'
INTO l_dummy
FROM wip_sales_order_lines_v
WHERE organization_id = l_flow_schedule_rec.organization_id
AND inventory_item_id = NVL(l_flow_schedule_rec.primary_item_id,
inventory_item_id)
AND NVL(demand_class,'@@@') =
NVL(l_flow_schedule_rec.demand_class,'@@@')
AND demand_source_header_id =
l_flow_schedule_rec.demand_source_header_id
AND demand_source_line = l_flow_schedule_rec.demand_source_line
AND demand_source_delivery =
l_flow_schedule_rec.demand_source_delivery;
SELECT 'VALID'
INTO l_dummy
FROM wip_lines
WHERE organization_id = l_flow_schedule_rec.organization_id
AND line_id = l_flow_schedule_rec.line_id;
SELECT 'VALID'
INTO l_dummy
FROM mtl_system_items
WHERE organization_id = l_flow_schedule_rec.organization_id
AND inventory_item_id = l_flow_schedule_rec.primary_item_id
AND build_in_wip_flag = 'Y'
AND pick_components_flag = 'N'
AND (l_see_eng_items = 1
OR (l_see_eng_items = 2 AND eng_item_flag = 'N') );
SELECT 'VALID'
INTO l_dummy
FROM mtl_routing_rev_highdate_v
WHERE organization_id = l_flow_schedule_rec.organization_id
AND inventory_item_id = l_flow_schedule_rec.primary_item_id
AND process_revision = l_flow_schedule_rec.routing_revision
AND l_flow_schedule_rec.routing_revision_date >= --fix bug#3170105
effectivity_date;
SELECT 'VALID'
INTO l_dummy
FROM wip_schedule_groups
WHERE organization_id = l_flow_schedule_rec.organization_id
AND schedule_group_id = l_flow_schedule_rec.schedule_group_id;
SELECT 'VALID'
INTO l_dummy
FROM mtl_task_v
WHERE project_id = l_flow_schedule_rec.project_id
AND task_id = l_flow_schedule_rec.task_id;
IF l_flow_schedule_rec.last_updated_by IS NOT NULL AND
( l_flow_schedule_rec.last_updated_by <>
p_old_flow_schedule_rec.last_updated_by OR
p_old_flow_schedule_rec.last_updated_by IS NULL )
THEN
IF NOT MRP_Validate.Last_Updated_By(l_flow_schedule_rec.last_updated_by) THEN
x_return_status := FND_API.G_RET_STS_ERROR;
IF l_flow_schedule_rec.last_update_date IS NOT NULL AND
( l_flow_schedule_rec.last_update_date <>
p_old_flow_schedule_rec.last_update_date OR
p_old_flow_schedule_rec.last_update_date IS NULL )
THEN
IF NOT MRP_Validate.Last_Update_Date(l_flow_schedule_rec.last_update_date) THEN
x_return_status := FND_API.G_RET_STS_ERROR;
IF l_flow_schedule_rec.last_update_login IS NOT NULL AND
( l_flow_schedule_rec.last_update_login <>
p_old_flow_schedule_rec.last_update_login OR
p_old_flow_schedule_rec.last_update_login IS NULL )
THEN
IF NOT MRP_Validate.Last_Update_Login(l_flow_schedule_rec.last_update_login) THEN
x_return_status := FND_API.G_RET_STS_ERROR;
IF l_flow_schedule_rec.program_update_date IS NOT NULL AND
( l_flow_schedule_rec.program_update_date <>
p_old_flow_schedule_rec.program_update_date OR
p_old_flow_schedule_rec.program_update_date IS NULL )
THEN
IF NOT MRP_Validate.Program_Update_Date(l_flow_schedule_rec.program_update_date) THEN
x_return_status := FND_API.G_RET_STS_ERROR;
PROCEDURE Entity_Delete
( x_return_status OUT NOCOPY VARCHAR2
, p_flow_schedule_rec IN MRP_Flow_Schedule_PVT.Flow_Schedule_PVT_Rec_Type
)
IS
l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
, 'Entity_Delete'
);
END Entity_Delete;