The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT Bom_Inventory_Components_S.NEXTVAL Component_Sequence
FROM SYS.DUAL;
SELECT To_End_Item_Unit_Number
FROM BOM_Inventory_Components
WHERE component_sequence_id =
g_rev_comp_unexp_rec.old_component_sequence_id;
SELECT nvl(max(item_num), 0) + P_Item_Seq_Increment default_seq
FROM bom_inventory_components
WHERE bill_sequence_id = g_rev_Comp_Unexp_rec.Bill_Sequence_Id;
SELECT decode(pick_components_flag, 'Y', 1, 2) pick_comps
FROM mtl_system_items
WHERE inventory_item_id = g_rev_comp_Unexp_rec.component_item_id
AND organization_id = g_rev_comp_Unexp_rec.organization_id;
SELECT STRUCTURE_TYPE_NAME,
ASSEMBLY_ITEM_ID,
ORGANIZATION_ID
INTO
l_Structure_Type_Name,
l_Assembly_Item_Id,
l_Organization_Id
FROM BOM_STRUCTURE_TYPES_B STRUCT_TYPE,
BOM_STRUCTURES_B BOM_STRUCT
WHERE BOM_STRUCT.STRUCTURE_TYPE_ID = STRUCT_TYPE.STRUCTURE_TYPE_ID
AND BOM_STRUCT.BILL_SEQUENCE_ID = g_Rev_Comp_Unexp_Rec.BILL_SEQUENCE_ID;
SELECT scheduled_date
FROM eng_revised_items
WHERE revised_item_sequence_id =
g_Rev_Comp_Unexp_Rec.revised_item_sequence_id;
SELECT default_include_in_rollup_flag
FROM mtl_system_items
WHERE inventory_item_id = g_Rev_Comp_Unexp_Rec.component_item_id
AND organization_id = g_Rev_Comp_Unexp_Rec.organization_id;
SELECT 1 atp_allowed
FROM mtl_system_items assy,
mtl_system_items comp
WHERE assy.organization_id=g_Rev_Comp_Unexp_Rec.organization_id
AND assy.inventory_item_id= g_Rev_Comp_Unexp_Rec.Revised_item_id
--AND assy.atp_components_flag = 'Y'
AND comp.organization_id = g_Rev_Comp_Unexp_Rec.organization_id
AND comp.inventory_item_id =
g_Rev_Comp_Unexp_Rec.component_item_id
AND comp.atp_flag IN ( 'Y', 'C', 'R');
SELECT bom_item_type
INTO l_bom_item_type
FROM mtl_system_items msi
WHERE msi.inventory_item_id =
g_Rev_Comp_Unexp_rec.component_item_id
AND msi.organization_id = g_Rev_Comp_Unexp_rec.organization_id;
SELECT list_price_per_unit
INTO l_unit_price
FROM mtl_system_items msi
WHERE msi.inventory_item_id =
g_Rev_Comp_Unexp_rec.component_item_id
AND msi.organization_id = g_Rev_Comp_Unexp_rec.organization_id
AND msi.inventory_item_flag = 'Y' --- to check whether this is a direct item
AND msi.stock_enabled_flag = 'N'
AND msi.eam_item_type is NOT NULL; -- to check if it is an eAM item
SELECT Bill_Sequence_Id
FROM bom_bill_of_materials bom
WHERE bom.assembly_item_id =
g_Rev_Comp_Unexp_Rec.revised_item_id
AND bom.organization_id =
g_Rev_Comp_Unexp_Rec.organization_id
AND NVL(bom.alternate_bom_designator, 'NONE') =
NVL(g_rev_component_rec.alternate_bom_code, 'NONE');
SELECT bill_sequence_id
FROM eng_revised_items
WHERE revised_item_sequence_id =
g_rev_comp_unexp_rec.revised_item_sequence_id;
SELECT BOM_INVENTORY_COMPONENTS_S.NextVal
INTO l_Bill_Sequence_Id
FROM SYS.DUAL;
SELECT meaning INTO l_enforce_int_reqvalue FROM mfg_lookups WHERE
lookup_type = 'BOM_ENFORCE_INT_REQUIREMENTS' AND
lookup_code = p_enforce_integer;
SELECT wip_supply_type,
wip_supply_subinventory,
wip_supply_locator_id
FROM mtl_system_items
WHERE inventory_item_id = p_rev_comp_unexp_rec.component_item_id
AND organization_id = p_rev_comp_unexp_rec.organization_id;
SELECT Bom_Item_Type
INTO l_assy_item_type
FROM Mtl_system_items_b
WHERE organization_id = g_Rev_Comp_Unexp_Rec.organization_id
AND inventory_item_id= g_Rev_Comp_Unexp_Rec.Revised_item_id;