The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE Update_Warranty_Entitlement (
p_module_type IN VARCHAR2 := NULL,
p_user_role IN VARCHAR2,
p_x_warranty_entl_rec IN OUT NOCOPY Warranty_Entl_Rec_Type
);
PROCEDURE Delete_Warranty_Entitlement (
p_module_type IN VARCHAR2 := NULL,
p_user_role IN VARCHAR2,
p_x_warranty_entl_rec IN OUT NOCOPY Warranty_Entl_Rec_Type
);
ELSIF (l_warranty_entl_tbl(i).operation_flag = G_OP_UPDATE) THEN
-- Procedure call to update the record in the table
Update_Warranty_Entitlement (
p_module_type => p_module_type,
p_user_role => p_user_role,
p_x_warranty_entl_rec => l_warranty_entl_tbl(i)
);
ELSIF (l_warranty_entl_tbl(i).operation_flag = G_OP_DELETE) THEN
-- Procedure call to delete the record from the table
Delete_Warranty_Entitlement (
p_module_type => p_module_type,
p_user_role => p_user_role,
p_x_warranty_entl_rec => l_warranty_entl_tbl(i)
);
SELECT 'X'
FROM AHL_VISIT_TASKS_B TSK,
AHL_MR_HEADERS_B MRH
WHERE MRH.warranty_template_id IS NOT NULL
AND MRH.mr_header_id = TSK.mr_id
AND TSK.visit_task_id = c_task_id;
SELECT 'X'
FROM AHL_VISIT_TASKS_B TSK,
AHL_MR_ROUTES MRR,
AHL_ROUTES_B ROUTE
WHERE ROUTE.warranty_template_id IS NOT NULL
AND ROUTE.route_id = MRR.route_id
AND MRR.mr_route_id = TSK.mr_route_id
AND TSK.visit_task_id = c_task_id;
SELECT VTK.instance_id
FROM AHL_VISIT_TASKS_B VTK, AHL_WARRANTY_ENTITLEMENTS ENT
WHERE VTK.visit_task_id = ENT.visit_task_id
AND ENT.warranty_entitlement_id = c_entl_id;
SELECT VTK.instance_id
FROM AHL_VISIT_TASKS_B VTK, AHL_WORKORDERS WO,
AHL_OSP_ORDER_LINES OSP, AHL_WARRANTY_ENTITLEMENTS ENT
WHERE VTK.visit_task_id = WO.visit_task_id
AND WO.workorder_id = OSP.workorder_id
AND OSP.workorder_id IS NOT NULL
AND OSP.osp_order_line_id = ENT.osp_order_line_id
AND ENT.warranty_entitlement_id = c_entl_id
UNION ALL
SELECT CSI.instance_id
FROM AHL_OSP_ORDER_LINES OSP, CSI_ITEM_INSTANCES CSI,
AHL_WARRANTY_ENTITLEMENTS ENT
WHERE CSI.last_vld_organization_id = OSP.inventory_org_id
AND CSI.inventory_item_id = OSP.inventory_item_id
AND CSI.serial_number = OSP.serial_number
AND OSP.workorder_id IS NULL
AND OSP.osp_order_line_id = ENT.osp_order_line_id
AND ENT.warranty_entitlement_id = c_entl_id;
SELECT OSPO.osp_order_number
FROM AHL_OSP_ORDERS_B OSPO, AHL_OSP_ORDER_LINES OSPL
WHERE OSPO.osp_order_id = OSPL.osp_order_id
AND OSPL.osp_order_line_id = c_osp_line_id;
SELECT osp_line_number
FROM AHL_OSP_ORDER_LINES
WHERE osp_order_line_id = c_osp_line_id;
SELECT FOS.meaning
FROM AHL_OSP_ORDER_LINES OSPL, FND_LOOKUP_VALUES_VL FOS
WHERE FOS.lookup_code = OSPL.status_code
AND FOS.lookup_type = 'AHL_OSP_LINE_STATUS_TYPE'
AND OSPL.osp_order_line_id = c_osp_line_id;
SELECT AHL_WARRANTY_ENTITLEMENTS_S.NEXTVAL INTO p_x_warranty_entl_rec.warranty_entitlement_id FROM DUAL;
p_x_warranty_entl_rec.last_updated_by := FND_GLOBAL.USER_ID;
p_x_warranty_entl_rec.last_update_date := SYSDATE;
p_x_warranty_entl_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
FND_LOG.string(l_log_statement, l_full_name, 'Before Insert_Row');
AHL_WARRANTY_ENTITLEMENTS_PKG.Insert_Row(
x_row_id => l_dummy_char,
x_warranty_entitlement_id => p_x_warranty_entl_rec.warranty_entitlement_id,
x_object_version_number => p_x_warranty_entl_rec.object_version_number,
x_warranty_contract_id => p_x_warranty_entl_rec.warranty_contract_id,
x_old_warranty_contract_id => l_contract_id,
x_entitlement_status_code => p_x_warranty_entl_rec.entitlement_status_code,
x_warranty_claim_id => p_x_warranty_entl_rec.warranty_claim_id,
x_po_header_id => p_x_warranty_entl_rec.po_header_id,
x_sr_incident_id => p_x_warranty_entl_rec.sr_incident_id,
x_visit_task_id => p_x_warranty_entl_rec.visit_task_id,
x_workorder_id => p_x_warranty_entl_rec.workorder_id,
x_osp_order_line_id => p_x_warranty_entl_rec.osp_order_line_id,
x_warranty_labour_capture => p_x_warranty_entl_rec.warranty_labour_capture,
x_warranty_mtl_capture => p_x_warranty_entl_rec.warranty_mtl_capture ,
x_order_claim_amount => p_x_warranty_entl_rec.order_claim_amount,
x_attribute_category => p_x_warranty_entl_rec.attribute_category,
x_attribute1 => p_x_warranty_entl_rec.attribute1,
x_attribute2 => p_x_warranty_entl_rec.attribute2,
x_attribute3 => p_x_warranty_entl_rec.attribute3,
x_attribute4 => p_x_warranty_entl_rec.attribute4,
x_attribute5 => p_x_warranty_entl_rec.attribute5,
x_attribute6 => p_x_warranty_entl_rec.attribute6,
x_attribute7 => p_x_warranty_entl_rec.attribute7,
x_attribute8 => p_x_warranty_entl_rec.attribute8,
x_attribute9 => p_x_warranty_entl_rec.attribute9,
x_attribute10 => p_x_warranty_entl_rec.attribute10,
x_attribute11 => p_x_warranty_entl_rec.attribute11,
x_attribute12 => p_x_warranty_entl_rec.attribute12,
x_attribute13 => p_x_warranty_entl_rec.attribute13,
x_attribute14 => p_x_warranty_entl_rec.attribute14,
x_attribute15 => p_x_warranty_entl_rec.attribute15,
x_creation_date => p_x_warranty_entl_rec.creation_date ,
x_created_by => p_x_warranty_entl_rec.created_by,
x_last_update_date => p_x_warranty_entl_rec.last_update_date,
x_last_updated_by => p_x_warranty_entl_rec.last_updated_by,
x_last_update_login => p_x_warranty_entl_rec.last_update_login
);
FND_LOG.string(l_log_statement, l_full_name, 'After Insert_Row');
PROCEDURE Update_Warranty_Entitlement (
p_module_type IN VARCHAR2 := NULL,
p_user_role IN VARCHAR2,
p_x_warranty_entl_rec IN OUT NOCOPY Warranty_Entl_Rec_Type
) IS
CURSOR warranty_entl_csr(c_warranty_entl_id NUMBER) IS
SELECT *
FROM AHL_WARRANTY_ENTITLEMENTS
WHERE warranty_entitlement_id = c_warranty_entl_id;
l_api_name CONSTANT VARCHAR2(30) := 'Update_Warranty_Entitlement';
FND_LOG.string(l_log_statement, l_full_name, 'invalid entitlement id for update');
FND_LOG.string(l_log_statement, l_full_name, 'Validate_Warranty_Entitlement for update had errors');
p_x_warranty_entl_rec.last_updated_by := FND_GLOBAL.USER_ID;
p_x_warranty_entl_rec.last_update_date := SYSDATE;
p_x_warranty_entl_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
FND_LOG.string(l_log_statement, l_full_name, 'Before Update_Row');
AHL_WARRANTY_ENTITLEMENTS_PKG.Update_Row(
x_warranty_entitlement_id => p_x_warranty_entl_rec.warranty_entitlement_id,
x_object_version_number => p_x_warranty_entl_rec.object_version_number,
x_warranty_contract_id => p_x_warranty_entl_rec.warranty_contract_id,
x_old_warranty_contract_id => l_contract_id,
x_entitlement_status_code => p_x_warranty_entl_rec.entitlement_status_code,
x_warranty_claim_id => p_x_warranty_entl_rec.warranty_claim_id,
x_po_header_id => p_x_warranty_entl_rec.po_header_id,
x_sr_incident_id => p_x_warranty_entl_rec.sr_incident_id,
x_visit_task_id => p_x_warranty_entl_rec.visit_task_id,
x_workorder_id => p_x_warranty_entl_rec.workorder_id,
x_osp_order_line_id => p_x_warranty_entl_rec.osp_order_line_id,
x_warranty_labour_capture => p_x_warranty_entl_rec.warranty_labour_capture,
x_warranty_mtl_capture => p_x_warranty_entl_rec.warranty_mtl_capture ,
x_order_claim_amount => p_x_warranty_entl_rec.order_claim_amount,
x_attribute_category => p_x_warranty_entl_rec.attribute_category,
x_attribute1 => p_x_warranty_entl_rec.attribute1,
x_attribute2 => p_x_warranty_entl_rec.attribute2,
x_attribute3 => p_x_warranty_entl_rec.attribute3,
x_attribute4 => p_x_warranty_entl_rec.attribute4,
x_attribute5 => p_x_warranty_entl_rec.attribute5,
x_attribute6 => p_x_warranty_entl_rec.attribute6,
x_attribute7 => p_x_warranty_entl_rec.attribute7,
x_attribute8 => p_x_warranty_entl_rec.attribute8,
x_attribute9 => p_x_warranty_entl_rec.attribute9,
x_attribute10 => p_x_warranty_entl_rec.attribute10,
x_attribute11 => p_x_warranty_entl_rec.attribute11,
x_attribute12 => p_x_warranty_entl_rec.attribute12,
x_attribute13 => p_x_warranty_entl_rec.attribute13,
x_attribute14 => p_x_warranty_entl_rec.attribute14,
x_attribute15 => p_x_warranty_entl_rec.attribute15,
x_last_update_date => p_x_warranty_entl_rec.last_update_date,
x_last_updated_by => p_x_warranty_entl_rec.last_updated_by,
x_last_update_login => p_x_warranty_entl_rec.last_update_login
);
FND_LOG.string(l_log_statement, l_full_name, 'After Update_Row');
END Update_Warranty_Entitlement;
PROCEDURE Delete_Warranty_Entitlement (
p_module_type IN VARCHAR2 := NULL,
p_user_role IN VARCHAR2,
p_x_warranty_entl_rec IN OUT NOCOPY Warranty_Entl_Rec_Type
) IS
--
l_api_name CONSTANT VARCHAR2(30) := 'Delete_Warranty_Entitlement';
FND_LOG.string(l_log_statement, l_full_name, 'Before Delete_Row');
AHL_WARRANTY_ENTITLEMENTS_PKG.Delete_Row(
x_warranty_entitlement_id => p_x_warranty_entl_rec.warranty_entitlement_id
);
FND_LOG.string(l_log_statement, l_full_name, 'After Delete_Row');
END Delete_Warranty_Entitlement;
SELECT *
FROM AHL_WARRANTY_ENTITLEMENTS
WHERE warranty_entitlement_id = c_warranty_entl_id;
SELECT 'X'
FROM AHL_WARRANTY_CONTRACTS_B
WHERE warranty_contract_id = c_contract_id
AND contract_status_code = 'ACTIVE';
FND_LOG.string(l_log_statement, l_full_name, 'Before approval update');
UPDATE AHL_WARRANTY_ENTITLEMENTS SET
warranty_contract_id = l_contract_id,
old_warranty_contract_id = l_contract_id,
entitlement_status_code = l_entl_status
WHERE warranty_entitlement_id = p_x_warranty_entl_rec.warranty_entitlement_id;
FND_LOG.string(l_log_statement, l_full_name, 'After approval update');
SELECT 'X'
FROM AHL_WARRANTY_CONTRACTS_B
WHERE warranty_contract_id = c_contract_id
AND contract_status_code = 'ACTIVE';
SELECT 'X'
FROM FND_LOOKUPS
WHERE lookup_code = NVL(c_entl_sts_code, 'X')
AND lookup_type = 'AHL_WARRANTY_ENTLMNT_STATUS'
AND NVL(end_date_active, SYSDATE + 1) > SYSDATE;
SELECT 'X'
FROM AHL_WARRANTY_CLAIMS_B
WHERE warranty_claim_id = c_claim_id
AND claim_status_code <> 'CANCELLED';
SELECT 'X'
FROM CS_INCIDENTS_ALL_B
WHERE incident_id = c_incident_id
AND incident_status_id <> 2; -- Closed status
SELECT 'X'
FROM AHL_VISIT_TASKS_B
WHERE visit_task_id = c_task_id
AND status_code NOT IN ('CANCELLED', 'DELETED');
SELECT 'X'
FROM AHL_WORKORDERS
WHERE workorder_id = c_wo_id;
SELECT 'X'
FROM AHL_OSP_ORDER_LINES
WHERE osp_order_line_id = c_line_id;