The following lines contain the word 'select', 'insert', 'update' or 'delete':
IF l_sub_component_rec.last_update_date = FND_API.G_MISS_DATE THEN
l_sub_component_rec.last_update_date := NULL;
IF l_sub_component_rec.last_updated_by = FND_API.G_MISS_NUM THEN
l_sub_component_rec.last_updated_by := NULL;
IF l_sub_component_rec.last_update_login = FND_API.G_MISS_NUM THEN
l_sub_component_rec.last_update_login := NULL;
IF l_sub_component_rec.program_update_date = FND_API.G_MISS_DATE THEN
l_sub_component_rec.program_update_date := NULL;
* Procedure : Update_Row
* Parameter IN : Substitute Component Record
* Sub. Comps Unexposed Cols. Record
* Parameter OUT : Return_Status - indicating success or failure
* Mesg_Token_Tbl - Filled with Errors or warnings
* Purpose : Update Row procedure will update the production rec
* to the new values as entered in the user record.
* Any errors are filled in the Mesg_Token_Tbl.
*
********************************************************************/
PROCEDURE Update_Row
( 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_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
, x_return_status IN OUT NOCOPY VARCHAR2
)
IS
l_processed BOOLEAN;
UPDATE BOM_SUBSTITUTE_COMPONENTS
SET SUBSTITUTE_COMPONENT_ID = DECODE(p_sub_comp_Unexp_rec.new_substitute_component_id,
NULL, p_sub_comp_Unexp_rec.substitute_component_id,
FND_API.G_MISS_NUM,
p_sub_comp_Unexp_rec.substitute_component_id,
p_sub_comp_Unexp_rec.new_substitute_component_id
)
, SUBSTITUTE_ITEM_QUANTITY =
p_sub_component_rec.substitute_item_quantity
, ATTRIBUTE_CATEGORY = p_sub_component_rec.attribute_category
, ATTRIBUTE1 = p_sub_component_rec.attribute1
, ATTRIBUTE2 = p_sub_component_rec.attribute2
, ATTRIBUTE3 = p_sub_component_rec.attribute3
, ATTRIBUTE4 = p_sub_component_rec.attribute4
, ATTRIBUTE5 = p_sub_component_rec.attribute5
, ATTRIBUTE6 = p_sub_component_rec.attribute6
, ATTRIBUTE7 = p_sub_component_rec.attribute7
, ATTRIBUTE8 = p_sub_component_rec.attribute8
, ATTRIBUTE9 = p_sub_component_rec.attribute9
, ATTRIBUTE10 = p_sub_component_rec.attribute10
, ATTRIBUTE11 = p_sub_component_rec.attribute11
, ATTRIBUTE12 = p_sub_component_rec.attribute12
, ATTRIBUTE13 = p_sub_component_rec.attribute13
, ATTRIBUTE14 = p_sub_component_rec.attribute14
, ATTRIBUTE15 = p_sub_component_rec.attribute15
, Original_system_Reference =
p_sub_component_rec.original_system_reference
, Enforce_Int_Requirements = p_sub_comp_unexp_rec.Enforce_Int_Requirements_Code
, LAST_UPDATE_DATE = SYSDATE
, LAST_UPDATED_BY = BOM_Globals.Get_User_Id
, LAST_UPDATE_LOGIN = BOM_Globals.Get_Login_Id
, REQUEST_ID = Fnd_Global.Conc_Request_Id
, PROGRAM_ID = Fnd_Global.Conc_Program_Id
, PROGRAM_APPLICATION_ID = Fnd_Global.Prog_Appl_Id
, PROGRAM_UPDATE_DATE = SYSDATE
WHERE SUBSTITUTE_COMPONENT_ID =
p_sub_comp_Unexp_rec.substitute_component_id
AND COMPONENT_SEQUENCE_ID = p_sub_comp_Unexp_rec.component_sequence_id
AND nvl(ACD_TYPE,1) = nvl(p_sub_component_rec.acd_type,1)
/* Bug 5726557; The code is modified to modify the substitute components
BOMPCMBM.Update_Related_Sub_Comp(p_component_sequence_id => p_sub_comp_Unexp_rec.component_sequence_id
, p_old_sub_comp_item_id => p_sub_comp_Unexp_rec.substitute_component_id
, p_new_sub_comp_item_id => nvl(p_sub_comp_Unexp_rec.new_substitute_component_id,
p_sub_comp_Unexp_rec.substitute_component_id)
, p_acd_type => p_sub_component_rec.acd_type
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Return_Status => x_return_status);
( p_Message_name => 'BOM_NOT_UPDATE_ROW'
, p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
);
'Utility (SubStitute Component Update)' ||
SUBSTR(SQLERRM, 1, 100);
END Update_Row;
SELECT common_component_sequence_id
INTO l_src_comp_seq_id
FROM bom_components_b
WHERE component_sequence_id = p_comp_seq_id
and component_sequence_id <> common_component_sequence_id;
* Procedure : Insert_Row
* Parameters IN : Substitute Component Record as given by the User
* Sub. Comps Unexposed Cols. Record
* Parameters OUT: Substitute Component Record
* Return_Status - Indicating success or faliure
* Mesg_Token_Tbl - Filled with any errors or warnings
* Purpose : Will Insert a new substitute component record in
* Bom_Substitute_Components table.
*
********************************************************************/
PROCEDURE Insert_Row
( 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_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
, x_return_status IN OUT NOCOPY VARCHAR2
)
IS
l_processed BOOLEAN;
Error_Handler.Write_Debug ('Inserting SCOMP Perform Writes ...');
INSERT INTO BOM_SUBSTITUTE_COMPONENTS
( SUBSTITUTE_COMPONENT_ID
, LAST_UPDATE_DATE
, LAST_UPDATED_BY
, CREATION_DATE
, CREATED_BY
, LAST_UPDATE_LOGIN
, SUBSTITUTE_ITEM_QUANTITY
, COMPONENT_SEQUENCE_ID
, ACD_TYPE
, CHANGE_NOTICE
, REQUEST_ID
, PROGRAM_APPLICATION_ID
, PROGRAM_UPDATE_DATE
, ATTRIBUTE_CATEGORY
, ATTRIBUTE1
, ATTRIBUTE2
, ATTRIBUTE3
, ATTRIBUTE4
, ATTRIBUTE5
, ATTRIBUTE6
, ATTRIBUTE7
, ATTRIBUTE8
, ATTRIBUTE9
, ATTRIBUTE10
, ATTRIBUTE11
, ATTRIBUTE12
, ATTRIBUTE13
, ATTRIBUTE14
, ATTRIBUTE15
, PROGRAM_ID
, Original_System_Reference
, Enforce_Int_Requirements
, Common_Component_Sequence_Id --bug 7713832
)
VALUES
( p_sub_comp_unexp_rec.substitute_component_id
, SYSDATE
, Bom_globals.Get_User_Id
, SYSDATE
, Bom_Globals.Get_User_Id
, Bom_Globals.Get_User_Id
, p_sub_component_rec.substitute_item_quantity
, p_sub_comp_Unexp_rec.component_sequence_id
, p_sub_component_rec.acd_type
, p_sub_component_rec.Eco_Name
, Fnd_Global.Conc_Request_Id /* Request Id */
, Bom_Globals.Get_Prog_AppId
, SYSDATE
, p_sub_component_rec.attribute_category
, p_sub_component_rec.attribute1
, p_sub_component_rec.attribute2
, p_sub_component_rec.attribute3
, p_sub_component_rec.attribute4
, p_sub_component_rec.attribute5
, p_sub_component_rec.attribute6
, p_sub_component_rec.attribute7
, p_sub_component_rec.attribute8
, p_sub_component_rec.attribute9
, p_sub_component_rec.attribute10
, p_sub_component_rec.attribute11
, p_sub_component_rec.attribute12
, p_sub_component_rec.attribute13
, p_sub_component_rec.attribute14
, p_sub_component_rec.attribute15
, Bom_Globals.Get_Prog_Id
, p_sub_component_rec.Original_System_Reference
, p_sub_comp_Unexp_rec.enforce_int_requirements_code
, l_src_comp_seq_id --bug 7713832
);
BOMPCMBM.Insert_Related_Sub_Comp(p_component_sequence_id => p_sub_comp_Unexp_rec.component_sequence_id
, p_sub_comp_item_id => p_sub_comp_unexp_rec.substitute_component_id
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_Return_Status => x_return_status);
'Utility (Substitute Component Insert)' ||
SUBSTR(SQLERRM, 1, 100);
END Insert_Row;
* Procedure : Delete_Row
* Parameters IN : Primary Key of Substitute Component Table
* Parameters OUT: Return_Status - Indicating success or faliure
* Mesg_Token_Tbl - Filled with any errors or warnings
* Purpose : Will delete a substitute component record using the
* primary unique key.
********************************************************************/
PROCEDURE Delete_Row
( p_substitute_component_id IN NUMBER
, p_change_notice IN VARCHAR2
, p_component_sequence_id IN NUMBER
, p_acd_type IN NUMBER
, x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
, x_return_status IN OUT NOCOPY VARCHAR2
)
IS
l_processed BOOLEAN;
DELETE FROM BOM_SUBSTITUTE_COMPONENTS
WHERE SUBSTITUTE_COMPONENT_ID = p_substitute_component_id
AND COMPONENT_SEQUENCE_ID = p_component_sequence_id
AND (( l_BO_Id = Bom_Globals.G_ECO_BO AND
ACD_TYPE = p_acd_type
) OR
(l_BO_Id = Bom_Globals.G_BOM_BO AND
acd_type IS NULL
)
);
BOMPCMBM.Delete_Related_Sub_Comp( p_src_comp_seq => p_component_sequence_id
, p_sub_comp_item_id => p_substitute_component_id
, x_return_status => x_return_status);
'Utility (Substitute Component Delete_Row)' ||
SUBSTR(SQLERRM, 1, 100);
END Delete_Row;
SELECT SUBSTITUTE_ITEM_QUANTITY
, ATTRIBUTE_CATEGORY
, ATTRIBUTE1
, ATTRIBUTE2
, ATTRIBUTE3
, ATTRIBUTE4
, ATTRIBUTE5
, ATTRIBUTE6
, ATTRIBUTE7
, ATTRIBUTE8
, ATTRIBUTE9
, ATTRIBUTE10
, ATTRIBUTE11
, ATTRIBUTE12
, ATTRIBUTE13
, ATTRIBUTE14
, ATTRIBUTE15
, CHANGE_NOTICE
, ACD_TYPE
, SUBSTITUTE_COMPONENT_ID
, COMPONENT_SEQUENCE_ID
, ENFORCE_INT_REQUIREMENTS
INTO l_sub_component_rec.substitute_item_quantity
, l_sub_component_rec.attribute_category
, l_sub_component_rec.attribute1
, l_sub_component_rec.attribute2
, l_sub_component_rec.attribute3
, l_sub_component_rec.attribute4
, l_sub_component_rec.attribute5
, l_sub_component_rec.attribute6
, l_sub_component_rec.attribute7
, l_sub_component_rec.attribute8
, l_sub_component_rec.attribute9
, l_sub_component_rec.attribute10
, l_sub_component_rec.attribute11
, l_sub_component_rec.attribute12
, l_sub_component_rec.attribute13
, l_sub_component_rec.attribute14
, l_sub_component_rec.attribute15
, l_Sub_Component_Rec.Eco_Name
, l_Sub_Component_Rec.Acd_Type
, x_Sub_comp_Unexp_Rec.Substitute_Component_Id
, x_Sub_Comp_Unexp_Rec.Component_Sequence_Id
, x_Sub_Comp_Unexp_Rec.enforce_int_requirements_code
FROM BOM_SUBSTITUTE_COMPONENTS
WHERE SUBSTITUTE_COMPONENT_ID = p_substitute_component_id
AND COMPONENT_SEQUENCE_ID = p_component_sequence_id
AND NVL(DECODE(ACD_TYPE, FND_API.G_MISS_NUM, null, acd_type), 1) =
NVL(DECODE(p_acd_type, FND_API.G_MISS_NUM, null, p_acd_type), 1)
/* Bug 5726557; The code is modified inorder to update an
SELECT meaning INTO l_sub_component_rec.enforce_int_requirements FROM mfg_lookups
WHERE lookup_type = 'BOM_ENFORCE_INT_REQUIREMENTS' AND
lookup_code = x_sub_comp_unexp_rec.enforce_int_requirements_code;
Insert_Row( p_sub_component_rec => l_sub_component_rec
, p_Sub_Comp_Unexp_Rec => l_sub_comp_unexp_rec
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_return_status => l_return_status
);
ELSIF l_sub_component_rec.transaction_type = Bom_Globals.G_OPR_UPDATE
THEN
Update_Row( p_sub_component_rec => l_sub_component_rec
, p_Sub_Comp_Unexp_Rec => l_sub_comp_unexp_rec
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_return_status => l_return_status
);
ELSIF l_sub_component_rec.transaction_type = Bom_Globals.G_OPR_DELETE
THEN
Delete_Row
( p_substitute_component_id =>
l_sub_comp_unexp_rec.substitute_component_id
, p_change_notice =>
l_sub_component_rec.eco_name
, p_component_sequence_id =>
l_sub_comp_unexp_rec.component_sequence_id
, p_acd_type =>
l_sub_component_rec.acd_type
, x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
, x_return_status => l_return_status
);