The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT bbom.bill_sequence_id ,
bbom.assembly_type,
bbom.assembly_item_id,
bic.ACD_TYPE,
bic.bom_item_type,
bic.component_item_id,
bic.implementation_date,
msi.bom_item_type
INTO l_rec_BSI,
l_rec_AST,
l_rec_AII,
l_parent_acd_type,
l_rec_BIT,
l_rec_CII,
l_rec_ID,
l_parent_BIT
FROM mtl_system_items msi,
bom_inventory_components bic,
bom_bill_of_materials bbom
WHERE msi.inventory_item_id = bbom.assembly_item_id
AND msi.organization_id = bbom.organization_id
AND bic.component_sequence_id =
p_Sub_Comp_Unexp_Rec.component_sequence_id
AND bic.bill_sequence_id = bbom.bill_sequence_id;
IF (p_sub_component_rec.Transaction_Type = Bom_Globals.G_OPR_UPDATE OR
p_sub_component_rec.Transaction_Type = Bom_Globals.G_OPR_CREATE)
THEN
Bom_Globals.Check_Approved_For_Process
( p_change_notice => p_sub_component_rec.Eco_Name
, p_organization_id => p_Sub_Comp_Unexp_Rec.Organization_Id
, x_processed =>l_processed
, x_err_text =>l_err_text
);
SELECT bom_item_type, bom_enabled_flag, eng_item_flag
INTO l_sbc_item_type, l_sbc_bom_enabled_flag, l_sbc_eng_item_flag
FROM mtl_system_items
WHERE organization_id = p_Sub_Comp_Unexp_Rec.Organization_Id
AND inventory_item_id = p_Sub_Comp_Unexp_Rec.substitute_component_id;
SELECT 1
INTO l_dummy
FROM bom_bill_of_materials bbom
WHERE rownum =1
AND bbom.common_bill_sequence_id = l_rec_BSI
AND bbom.organization_id <> bbom.common_organization_id
AND not exists
(SELECT null
FROM mtl_system_items msi
WHERE msi.organization_id = bbom.organization_id
AND msi.inventory_item_id =
p_Sub_Comp_Unexp_Rec.substitute_component_id
AND msi.bom_enabled_flag = 'Y'
AND msi.bom_item_type = 4
AND (bbom.assembly_type = 2 OR
(bbom.assembly_type = 1 AND msi.eng_item_flag = 'N')));
l_token_tbl.DELETE;
IF (p_Sub_Component_Rec.Transaction_Type = Bom_Globals.G_OPR_UPDATE AND
p_Sub_Comp_Unexp_Rec.Component_Sequence_Id IN
(l_rec_AII, l_rec_CII))
OR
(p_Sub_Component_Rec.Transaction_Type = Bom_Globals.G_OPR_CREATE AND
p_Sub_Comp_Unexp_Rec.Substitute_Component_Id IN
(l_rec_AII,l_rec_CII))
THEN
IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
Error_Handler.Add_Error_Token
( x_Mesg_Token_tbl => l_Mesg_Token_tbl
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_message_name => 'ENG_SUBCOMP_SAMEAS_ITEM_COMP'
, p_token_tbl => l_token_tbl
);
p_Sub_Component_Rec.Transaction_Type = Bom_Globals.G_OPR_UPDATE
)
THEN
l_sub_comp_unique:= Verify_Unique_Substitute( p_sub_component_rec
, p_sub_comp_Unexp_rec
);
SELECT 1
INTO l_dummy
FROM bom_substitute_components sub_comp,
bom_inventory_components rev_comp
WHERE sub_comp.component_sequence_id =
p_Sub_Comp_Unexp_Rec.Component_Sequence_Id
AND sub_comp.Substitute_Component_Id =
p_Sub_Comp_Unexp_Rec.Substitute_Component_Id
AND rev_comp.component_sequence_id =
p_Sub_Comp_Unexp_Rec.Component_Sequence_Id
AND rev_comp.implementation_date IS NOT NULL;
* Procedure : Check_Entity_Delete
* Parameter IN : Substitute Component Record
* Substitute component Record of Unexposed Columns
* Parameter OUT : Return_Status - Indicating status of the process.
* Mesg_Token_Tbl - Table of Errors and their tokens
*
* Purpose : Entity_Delete procedure will verify if the record
* can be delete without violating any dependency rules
*********************************************************************/
PROCEDURE Check_Entity_Delete
( x_return_status OUT NOCOPY VARCHAR2
, x_Mesg_Token_Tbl OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
, p_sub_component_rec IN Bom_Bo_Pub.Sub_Component_Rec_Type
, p_Sub_Comp_Unexp_Rec IN Bom_Bo_Pub.Sub_Comp_Unexposed_Rec_Type
)
IS
l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
END Check_Entity_Delete;
* when the operation is Update/Delete and does not exist when
* the operation is Create. If the operation is Update/Delete
* the procedure will query the existing record and return them
* as old records.
***************************************************************************/
PROCEDURE Check_Existence
( p_sub_component_rec IN Bom_Bo_Pub.Sub_Component_Rec_Type
, p_sub_comp_unexp_rec IN Bom_Bo_Pub.Sub_Comp_Unexposed_Rec_Type
, x_old_sub_component_rec IN OUT NOCOPY Bom_Bo_Pub.Sub_Component_Rec_Type
, x_old_sub_comp_unexp_rec IN OUT NOCOPY Bom_Bo_Pub.Sub_Comp_Unexposed_Rec_Type
, x_Mesg_Token_Tbl OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
, x_Return_Status OUT NOCOPY VARCHAR2
)
IS
l_token_tbl Error_Handler.Token_Tbl_Type;
(Bom_Globals.G_OPR_UPDATE, Bom_Globals.G_OPR_DELETE)
THEN
Error_Handler.Add_Error_Token
( x_Mesg_token_tbl => l_Mesg_Token_Tbl
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, p_message_name => 'ENG_SUB_COMP_DOESNOT_EXIST'
, p_token_tbl => l_token_tbl
);
SELECT revised_item_sequence_id
FROM bom_inventory_components
WHERE component_item_id = p_sub_comp_unexp_rec.component_item_id
AND operation_seq_num = p_sub_component_rec.operation_sequence_number
AND effectivity_date = p_sub_component_rec.start_effective_date
AND bill_sequence_id = p_sub_comp_unexp_rec.bill_sequence_id;
SELECT bom_item_type
FROM mtl_system_items
WHERE inventory_item_id = p_sub_comp_unexp_rec.substitute_component_id
AND organization_id = p_sub_comp_unexp_rec.organization_id;
l_token_tbl.DELETE(2);