The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select bom.assembly_item_id,
bom.organization_id,
bom.common_bill_sequence_id,
bom.common_assembly_item_id,
bom.common_organization_id,
msi.base_item_id,
bom.source_bill_sequence_id
From bom_bill_of_materials bom,
mtl_system_items msi
Where bom.bill_sequence_id = P_Bill_Sequence_id
and msi.inventory_item_id = bom.assembly_item_id
and msi.organization_id = bom.organization_id;
Select mif.item_number part,
mif.description description
From mtl_item_flexfields mif
Where mif.inventory_item_id = P_Common_Assembly_Item_Id
And mif.organization_id = P_Common_Organization_Id;
SELECT mp.organization_code ORGANIZATION_CODE, hou.name ORGANIZATION_NAME
FROM hr_all_organization_units_vl hou,
mtl_parameters mp
WHERE mp.organization_id = hou.organization_id
AND hou.organization_id = P_Common_Organization_Id;
Select mif.item_number part,
mif.description description
From mtl_item_flexfields mif
Where mif.inventory_item_id = P_Base_Item_Id
And mif.organization_id = P_Org_Id;
SELECT nvl(max(item_num), 0) + P_Item_Seq_Increment default_seq
FROM bom_inventory_components
WHERE bill_sequence_id = P_Bill_Sequence_Id;
SELECT 1 INTO dummy FROM dual
WHERE not exists
(SELECT 1 FROM bom_bill_of_materials
WHERE assembly_item_id = X_Assembly_item_id
AND nvl(alternate_bom_designator,'no alt') =
nvl(X_alternate_bom_designator,'no alt')
AND organization_id = X_organization_id
AND ((X_rowid is NULL) OR (rowid <> X_rowid))
);
PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2,
X_Assembly_Item_Id NUMBER,
X_Organization_Id NUMBER,
X_Alternate_Bom_Designator VARCHAR2,
X_Last_Update_Date DATE,
X_Last_Updated_By NUMBER,
X_Creation_Date DATE,
X_Created_By NUMBER,
X_Last_Update_Login NUMBER,
X_Common_Assembly_Item_Id NUMBER,
X_Specific_Assembly_Comment VARCHAR2,
X_Pending_From_Ecn VARCHAR2,
X_Attribute_Category VARCHAR2,
X_Attribute1 VARCHAR2,
X_Attribute2 VARCHAR2,
X_Attribute3 VARCHAR2,
X_Attribute4 VARCHAR2,
X_Attribute5 VARCHAR2,
X_Attribute6 VARCHAR2,
X_Attribute7 VARCHAR2,
X_Attribute8 VARCHAR2,
X_Attribute9 VARCHAR2,
X_Attribute10 VARCHAR2,
X_Attribute11 VARCHAR2,
X_Attribute12 VARCHAR2,
X_Attribute13 VARCHAR2,
X_Attribute14 VARCHAR2,
X_Attribute15 VARCHAR2,
X_Assembly_Type NUMBER,
X_Common_Bill_Sequence_Id IN OUT NOCOPY NUMBER,
X_Bill_Sequence_Id IN OUT NOCOPY NUMBER,
X_Common_Organization_Id NUMBER,
X_Next_Explode_Date DATE,
X_structure_type_id NUMBER := NULL,
X_implementation_date DATE := NULL,
X_effectivity_control NUMBER := NULL
) IS
l_preferred_flag Varchar2(1);
CURSOR C IS SELECT rowid FROM BOM_BILL_OF_MATERIALS
WHERE bill_sequence_id = X_Bill_Sequence_Id;
CURSOR C2 IS SELECT bom_inventory_components_s.nextval FROM sys.dual;
SELECT bill_sequence_id
INTO X_Common_Bill_Sequence_Id
FROM bom_bill_of_materials
WHERE organization_id = X_Common_Organization_Id
AND bill_sequence_id = common_bill_sequence_id
AND assembly_item_id = X_Common_Assembly_Item_Id
AND NVL(alternate_bom_designator, 'NONE') =
NVL(X_Alternate_Bom_Designator,'NONE');
INSERT INTO BOM_BILL_OF_MATERIALS
( assembly_item_id,
organization_id,
alternate_bom_designator,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login,
common_assembly_item_id,
specific_assembly_comment,
pending_from_ecn,
attribute_category,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15,
assembly_type,
common_bill_sequence_id,
bill_sequence_id,
common_organization_id,
next_explode_date,
structure_type_id,
implementation_date,
effectivity_control,
is_preferred,
source_bill_sequence_id,
pk1_value,
pk2_value
) VALUES (
X_Assembly_Item_Id,
X_Organization_Id,
X_Alternate_Bom_Designator,
X_Last_Update_Date,
X_Last_Updated_By,
X_Creation_Date,
X_Created_By,
X_Last_Update_Login,
X_Common_Assembly_Item_Id,
X_Specific_Assembly_Comment,
X_Pending_From_Ecn,
X_Attribute_Category,
X_Attribute1,
X_Attribute2,
X_Attribute3,
X_Attribute4,
X_Attribute5,
X_Attribute6,
X_Attribute7,
X_Attribute8,
X_Attribute9,
X_Attribute10,
X_Attribute11,
X_Attribute12,
X_Attribute13,
X_Attribute14,
X_Attribute15,
X_Assembly_Type,
X_Common_Bill_Sequence_Id,
X_Bill_Sequence_Id,
X_Common_Organization_Id,
X_Next_Explode_Date,
X_structure_type_id,
X_implementation_date,
X_effectivity_control,
decode ( l_preferred_flag, 'N',null,'Y'),
X_Common_Bill_Sequence_Id,
X_Assembly_Item_Id,
X_Organization_Id
);
, p_last_update_date => X_Last_Update_Date
, p_last_updated_by => X_Last_Updated_By
, p_creation_date => X_Creation_Date
, p_created_by => X_Created_By
, p_last_update_login=> X_Last_Update_Login
);
END Insert_Row;
SELECT *
FROM BOM_BILL_OF_MATERIALS
WHERE rowid = X_Rowid
FOR UPDATE of Bill_Sequence_Id NOWAIT;
FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
PROCEDURE Update_Row(X_Rowid VARCHAR2,
X_Assembly_Item_Id NUMBER,
X_Organization_Id NUMBER,
X_Alternate_Bom_Designator VARCHAR2,
X_Last_Update_Date DATE,
X_Last_Updated_By NUMBER,
X_Last_Update_Login NUMBER,
X_Common_Assembly_Item_Id NUMBER,
X_Specific_Assembly_Comment VARCHAR2,
X_Pending_From_Ecn VARCHAR2,
X_Attribute_Category VARCHAR2,
X_Attribute1 VARCHAR2,
X_Attribute2 VARCHAR2,
X_Attribute3 VARCHAR2,
X_Attribute4 VARCHAR2,
X_Attribute5 VARCHAR2,
X_Attribute6 VARCHAR2,
X_Attribute7 VARCHAR2,
X_Attribute8 VARCHAR2,
X_Attribute9 VARCHAR2,
X_Attribute10 VARCHAR2,
X_Attribute11 VARCHAR2,
X_Attribute12 VARCHAR2,
X_Attribute13 VARCHAR2,
X_Attribute14 VARCHAR2,
X_Attribute15 VARCHAR2,
X_Assembly_Type NUMBER,
X_Common_Bill_Sequence_Id IN OUT NOCOPY NUMBER,
X_Bill_Sequence_Id NUMBER,
X_Common_Organization_Id NUMBER,
X_Next_Explode_Date DATE,
X_structure_type_id NUMBER := NULL,
X_implementation_date DATE := NULL,
X_effectivity_control NUMBER := NULL
) IS
l_creation_date DATE;
SELECT bill_sequence_id
INTO X_Common_Bill_Sequence_Id
FROM bom_bill_of_materials
WHERE organization_id = X_Common_Organization_Id
AND bill_sequence_id = common_bill_sequence_id
AND assembly_item_id = X_Common_Assembly_Item_Id
AND NVL(alternate_bom_designator, 'NONE') =
NVL(X_Alternate_Bom_Designator,'NONE');
UPDATE BOM_BILL_OF_MATERIALS
SET
assembly_item_id = X_Assembly_Item_Id,
organization_id = X_Organization_Id,
alternate_bom_designator = X_Alternate_Bom_Designator,
last_update_date = X_Last_Update_Date,
last_updated_by = X_Last_Updated_By,
last_update_login = X_Last_Update_Login,
common_assembly_item_id = X_Common_Assembly_Item_Id,
specific_assembly_comment = X_Specific_Assembly_Comment,
pending_from_ecn = X_Pending_From_Ecn,
attribute_category = X_Attribute_Category,
attribute1 = X_Attribute1,
attribute2 = X_Attribute2,
attribute3 = X_Attribute3,
attribute4 = X_Attribute4,
attribute5 = X_Attribute5,
attribute6 = X_Attribute6,
attribute7 = X_Attribute7,
attribute8 = X_Attribute8,
attribute9 = X_Attribute9,
attribute10 = X_Attribute10,
attribute11 = X_Attribute11,
attribute12 = X_Attribute12,
attribute13 = X_Attribute13,
attribute14 = X_Attribute14,
attribute15 = X_Attribute15,
assembly_type = X_Assembly_Type,
common_bill_sequence_id = X_Common_Bill_Sequence_Id,
bill_sequence_id = X_Bill_Sequence_Id,
common_organization_id = X_Common_Organization_Id,
next_explode_date = X_Next_Explode_Date,
structure_type_id = X_structure_type_id,
implementation_date = X_implementation_date,
effectivity_control = X_effectivity_control
WHERE rowid = X_Rowid;
SELECT creation_date,created_by INTO l_creation_date,l_created_by
FROM bom_bill_of_materials
WHERE organization_id = X_Organization_Id
AND bill_sequence_id = X_Bill_Sequence_Id
AND assembly_item_id = X_Assembly_Item_Id
AND NVL(alternate_bom_designator, 'NONE') =
NVL(X_Alternate_Bom_Designator,'NONE');
, p_last_update_date => X_Last_Update_Date
, p_last_updated_by => X_Last_Updated_By
, p_creation_date => l_creation_date
, p_created_by => l_created_by
, p_last_update_login=> X_Last_Update_Login
);
END Update_Row;
PROCEDURE Delete_Row(X_Rowid VARCHAR2) IS
l_Structure_Name VARCHAR2(10);
DELETE FROM BOM_BILL_OF_MATERIALS
WHERE rowid = X_Rowid;
END Delete_Row;