The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT 'Y' from dual where exists (SELECT 'X' FROM ozf_offer_discount_lines WHERE offer_discount_line_id = cp_offerDiscountLineId AND tier_type = 'PBH');
SELECT 1 FROM DUAL WHERE EXISTS
(
SELECT 1 FROM OZF_OFFR_DISC_STRUCT_NAME_TL tl, ozf_offr_disc_struct_name_b b, ozf_offer_discount_lines l
WHERE b.offr_disc_struct_name_id = tl.offr_disc_struct_name_id
AND tl.LANGUAGE = userenv('LANG')
AND l.offer_discount_line_id = b.offer_discount_line_id
AND tl.discount_table_name = p_name
AND l.offer_id = p_offer_id
);
SELECT volume_type FROM ozf_offer_discount_lines
WHERE offer_discount_line_id = p_offer_discount_line_id;
ELSIF p_validation_mode = JTF_PLSQL_API.g_update then
IF p_vo_disc_rec.volume_type IS NULL OR p_vo_disc_rec.volume_type = FND_API.G_MISS_CHAR THEN
OPEN c_volume_type(p_vo_disc_rec.offer_discount_line_id);
SELECT offer_type FROM ozf_offers
WHERE offer_id = p_offer_id;
SELECT tier_type FROM ozf_offer_discount_lines
WHERE offer_discount_line_id = p_offer_discount_line_id;
ELSIF p_validation_mode = JTF_PLSQL_API.g_update then
IF p_vo_disc_rec.tier_type IS NULL OR p_vo_disc_rec.tier_type = FND_API.G_MISS_CHAR THEN
OPEN c_tier_type(p_vo_disc_rec.offer_discount_line_id);
SELECT 1 FROM dual WHERE EXISTS(SELECT 'X'
FROM ozf_offer_discount_lines
WHERE tier_type = 'DIS'
AND (
( cp_volumeFrom BETWEEN volume_from AND volume_to)
OR
(cp_volumeTo BETWEEN volume_from AND volume_to )
)
AND offer_id = cp_offerId
AND parent_discount_line_id = cp_parentDiscountLineId
AND offer_discount_line_id <> cp_offerDiscountLineId
);
SELECT 1 FROM dual WHERE EXISTS(SELECT 'X'
FROM ozf_offer_discount_lines
WHERE tier_type = 'DIS'
AND (
(volume_to IN (cp_volumeFrom , cp_volumeFrom -1 ))
OR
(volume_from IN ( cp_volumeTo , cp_volumeTo + 1 ))
)
AND offer_id = cp_offerId
AND parent_discount_line_id = cp_offerDiscountLineId
);
SELECT 'Y'
FROM dual
WHERE EXISTS (SELECT 'X'
FROM ozf_offer_discount_lines
WHERE parent_discount_line_id = cp_parentDiscountLineId
);
SELECT offer_id
FROM ozf_offer_discount_lines
WHERE offer_discount_line_id = cp_offerDiscountLineId;
SELECT transaction_currency_code
FROM ozf_offers
WHERE offer_id = cp_offerId;
SELECT discount_type INTO l_discount_type FROM OZF_OFFER_DISCOUNT_LINES
WHERE OFFER_DISCOUNT_LINE_ID = p_vo_disc_rec.parent_discount_line_id;
PROCEDURE Delete_vo_discount(
p_api_version_number IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_offer_discount_line_id IN NUMBER,
p_object_version_number IN NUMBER
)
IS
L_API_NAME CONSTANT VARCHAR2(30) := 'Delete_vo_discount';
SAVEPOINT Delete_vo_discount_PVT;
OZF_Create_Ozf_Prod_Line_PKG.Delete_Product(
p_offer_discount_line_id => p_offer_discount_line_id
);
OZF_Offer_Adj_Line_PVT.debug_message('Done calling Delete product');
SELECT object_version_number, offr_disc_struct_name_id INTO l_object_version_number, l_offr_disc_struct_name_id
FROM ozf_offr_disc_struct_name_b
WHERE offer_discount_line_id = p_offer_discount_line_id;
OZF_VO_DISC_STRUCT_NAME_PKG.Delete_Row(
p_offr_disc_struct_name_id => l_offr_disc_struct_name_id,
p_object_version_number => l_object_version_number);
OZF_Offer_Adj_Line_PVT.debug_message('Done calling Delete name');
OZF_DISC_LINE_PKG.delete_tiers(p_offer_discount_line_id => p_offer_discount_line_id);
OZF_DISC_LINE_PKG.Delete_Row(
p_offer_discount_line_id => p_offer_discount_line_id,
p_object_version_number => p_object_version_number
);
ROLLBACK TO Delete_vo_discount_PVT;
ROLLBACK TO Delete_vo_discount_PVT;
ROLLBACK TO Delete_vo_discount_PVT;
END Delete_vo_discount;
SELECT a.offer_id
, a.tier_type
, a.volume_type
, a.volume_break_type
, a.discount_type
, a.start_date_active
, a.end_date_active
, a.uom_code
, tl.discount_table_name
, tl.description
, a.tier_level
FROM OZF_OFFER_DISCOUNT_LINES a, ozf_offr_disc_struct_name_b b, ozf_offr_disc_struct_name_tl tl
WHERE a.offer_discount_line_id = b.offer_discount_line_id
AND b.offr_disc_struct_name_id = tl.offr_disc_struct_name_id
AND tl.language = userenv('LANG')
AND a.offer_discount_line_id = p_offer_discount_line_id;
SELECT offer_id
, tier_type
, volume_from
, volume_to
, volume_operator
, volume_break_type
, discount
, start_date_active
, end_date_active
, formula_id
, tier_level
FROM ozf_offer_discount_lines
WHERE parent_discount_line_id = p_offer_discount_line_id;
SELECT *
FROM OZF_OFFER_DISCOUNT_LINES
WHERE offer_discount_line_id = p_offer_discount_line_id
AND object_version_number = p_object_version_number;
OZF_Utility_PVT.Error_Message(p_message_name => 'API_MISSING_UPDATE_TARGET'
, p_token_name => 'INFO'
, p_token_value => 'DISCOUNT LINE') ;
, p_token_value => 'Last_Update_Date') ;
SELECT ozf_offer_discount_lines_s.NEXTVAL
FROM dual;
SELECT 1
FROM OZF_OFFER_DISCOUNT_LINES
WHERE offer_discount_line_id = l_id;
SELECT ozf_offr_disc_struct_name_s.NEXTVAL
FROM dual;
SELECT 1
FROM ozf_offr_disc_struct_name_b
WHERE OFFR_DISC_STRUCT_NAME_ID = l_id;
OZF_DISC_LINE_PKG.Insert_Row(
px_offer_discount_line_id => l_vo_discount_line_id,
p_parent_discount_line_id => l_vo_discount_rec.parent_discount_line_id,
p_volume_from => l_vo_discount_rec.volume_from,
p_volume_to => l_vo_discount_rec.volume_to,
p_volume_operator => l_vo_discount_rec.volume_operator,
p_volume_type => l_vo_discount_rec.volume_type,
p_volume_break_type => l_vo_discount_rec.volume_break_type,
p_discount => l_vo_discount_rec.discount,
p_discount_type => l_vo_discount_rec.discount_type,
p_tier_type => l_vo_discount_rec.tier_type,
p_tier_level => l_vo_discount_rec.tier_level,
p_incompatibility_group => l_vo_discount_rec.incompatibility_group,
p_precedence => l_vo_discount_rec.precedence,
p_bucket => l_vo_discount_rec.bucket,
p_scan_value => l_vo_discount_rec.scan_value,
p_scan_data_quantity => l_vo_discount_rec.scan_data_quantity,
p_scan_unit_forecast => l_vo_discount_rec.scan_unit_forecast,
p_channel_id => l_vo_discount_rec.channel_id,
p_adjustment_flag => l_vo_discount_rec.adjustment_flag,
p_start_date_active => l_vo_discount_rec.start_date_active,
p_end_date_active => l_vo_discount_rec.end_date_active,
p_uom_code => l_vo_discount_rec.uom_code,
p_creation_date => SYSDATE,
p_created_by => FND_GLOBAL.USER_ID,
p_last_update_date => SYSDATE,
p_last_updated_by => FND_GLOBAL.USER_ID,
p_last_update_login => FND_GLOBAL.conc_login_id,
px_object_version_number => l_object_version_number,
p_offer_id => l_vo_discount_rec.offer_id,
p_context => l_vo_discount_rec.context,
p_attribute1 => l_vo_discount_rec.attribute1,
p_attribute2 => l_vo_discount_rec.attribute2,
p_attribute3 => l_vo_discount_rec.attribute3,
p_attribute4 => l_vo_discount_rec.attribute4,
p_attribute5 => l_vo_discount_rec.attribute5,
p_attribute6 => l_vo_discount_rec.attribute6,
p_attribute7 => l_vo_discount_rec.attribute7,
p_attribute8 => l_vo_discount_rec.attribute8,
p_attribute9 => l_vo_discount_rec.attribute9,
p_attribute10 => l_vo_discount_rec.attribute10,
p_attribute11 => l_vo_discount_rec.attribute11,
p_attribute12 => l_vo_discount_rec.attribute12,
p_attribute13 => l_vo_discount_rec.attribute13,
p_attribute14 => l_vo_discount_rec.attribute14,
p_attribute15 => l_vo_discount_rec.attribute15,
p_formula_id => l_vo_discount_rec.formula_id
);
OZF_VO_DISC_STRUCT_NAME_PKG.Insert_Row(
px_offr_disc_struct_name_id => l_offr_disc_struct_name_id
, p_offer_discount_line_id => x_vo_discount_line_id
, p_creation_date => SYSDATE
, p_created_by => FND_GLOBAL.USER_ID
, p_last_updated_by => FND_GLOBAL.USER_ID
, p_last_update_date => SYSDATE
, p_last_update_login => FND_GLOBAL.conc_login_id
, p_name => l_vo_discount_rec.name
, p_description => l_vo_discount_rec.description
, px_object_version_number => l_struct_object_version
);
PROCEDURE Update_vo_discount(
p_api_version_number IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_vo_disc_rec IN vo_disc_rec_type
)IS
CURSOR c_get_vo_disc_line(p_offer_discount_line_id NUMBER, p_object_version_number NUMBER) IS
SELECT *
FROM OZF_OFFER_DISCOUNT_LINES
WHERE offer_discount_line_id = p_offer_discount_line_id
AND object_version_number = p_object_version_number;
l_api_name CONSTANT VARCHAR2(30) := 'Update_vo_discount';
SAVEPOINT update_ozf_disc_line_pvt;
OZF_Offer_Adj_Line_PVT.debug_message('Private API: - Open Cursor to Select');
OZF_Utility_PVT.Error_Message(p_message_name => 'API_MISSING_UPDATE_TARGET'
, p_token_name => 'INFO'
, p_token_value => 'Ozf_Disc_Line') ;
, p_token_value => 'Last_Update_Date') ;
, p_validation_mode => JTF_PLSQL_API.g_update
, x_return_status => x_return_status
, x_msg_count => x_msg_count
, x_msg_data => x_msg_data
);
OZF_DISC_LINE_PKG.Update_Row(
p_offer_discount_line_id => l_tar_vo_disc_line_rec.offer_discount_line_id,
p_parent_discount_line_id => l_tar_vo_disc_line_rec.parent_discount_line_id,
p_volume_from => l_tar_vo_disc_line_rec.volume_from,
p_volume_to => l_tar_vo_disc_line_rec.volume_to,
p_volume_operator => l_tar_vo_disc_line_rec.volume_operator,
p_volume_type => l_tar_vo_disc_line_rec.volume_type,
p_volume_break_type => l_tar_vo_disc_line_rec.volume_break_type,
p_discount => l_tar_vo_disc_line_rec.discount,
p_discount_type => l_tar_vo_disc_line_rec.discount_type,
p_tier_type => l_tar_vo_disc_line_rec.tier_type,
p_tier_level => l_tar_vo_disc_line_rec.tier_level,
p_incompatibility_group => l_tar_vo_disc_line_rec.incompatibility_group,
p_precedence => l_tar_vo_disc_line_rec.precedence,
p_bucket => l_tar_vo_disc_line_rec.bucket,
p_scan_value => l_tar_vo_disc_line_rec.scan_value,
p_scan_data_quantity => l_tar_vo_disc_line_rec.scan_data_quantity,
p_scan_unit_forecast => l_tar_vo_disc_line_rec.scan_unit_forecast,
p_channel_id => l_tar_vo_disc_line_rec.channel_id,
p_adjustment_flag => l_tar_vo_disc_line_rec.adjustment_flag,
p_start_date_active => l_tar_vo_disc_line_rec.start_date_active,
p_end_date_active => l_tar_vo_disc_line_rec.end_date_active,
p_uom_code => l_tar_vo_disc_line_rec.uom_code,
p_last_update_date => SYSDATE,
p_last_updated_by => FND_GLOBAL.USER_ID,
p_last_update_login => FND_GLOBAL.conc_login_id,
p_object_version_number => l_tar_vo_disc_line_rec.object_version_number,
p_context => l_tar_vo_disc_line_rec.context,
p_attribute1 => l_tar_vo_disc_line_rec.attribute1,
p_attribute2 => l_tar_vo_disc_line_rec.attribute2,
p_attribute3 => l_tar_vo_disc_line_rec.attribute3,
p_attribute4 => l_tar_vo_disc_line_rec.attribute4,
p_attribute5 => l_tar_vo_disc_line_rec.attribute5,
p_attribute6 => l_tar_vo_disc_line_rec.attribute6,
p_attribute7 => l_tar_vo_disc_line_rec.attribute7,
p_attribute8 => l_tar_vo_disc_line_rec.attribute8,
p_attribute9 => l_tar_vo_disc_line_rec.attribute9,
p_attribute10 => l_tar_vo_disc_line_rec.attribute10,
p_attribute11 => l_tar_vo_disc_line_rec.attribute11,
p_attribute12 => l_tar_vo_disc_line_rec.attribute12,
p_attribute13 => l_tar_vo_disc_line_rec.attribute13,
p_attribute14 => l_tar_vo_disc_line_rec.attribute14,
p_attribute15 => l_tar_vo_disc_line_rec.attribute15,
p_offer_id => l_tar_vo_disc_line_rec.offer_id,
p_formula_id => l_tar_vo_disc_line_rec.formula_id
);
SELECT tier_type into l_tier_type FROM ozf_offer_discount_lines
WHERE offer_discount_line_id = p_vo_disc_rec.offer_discount_line_id;
SELECT object_version_number, offr_disc_struct_name_id into l_struct_object_version , l_offr_disc_struct_name_id
FROM ozf_offr_disc_struct_name_b
WHERE offer_discount_line_id = p_vo_disc_rec.offer_discount_line_id;
OZF_VO_DISC_STRUCT_NAME_PKG.Update_Row(
p_offr_disc_struct_name_id => l_offr_disc_struct_name_id
, p_offer_discount_line_id => p_vo_disc_rec.offer_discount_line_id
, p_last_updated_by => FND_GLOBAL.USER_ID
, p_last_update_date => SYSDATE
, p_last_update_login => FND_GLOBAL.conc_login_id
, p_name => p_vo_disc_rec.name
, p_description => p_vo_disc_rec.description
, px_object_version_number => l_struct_object_version
);
ROLLBACK TO UPDATE_Ozf_Disc_Line_PVT;
ROLLBACK TO UPDATE_Ozf_Disc_Line_PVT;
ROLLBACK TO UPDATE_Ozf_Disc_Line_PVT;
END Update_vo_discount;
OZF_Offer_Adj_Line_PVT.debug_message('In Update Mode');
SELECT 1 FROM mtl_item_uoms_view
WHERE organization_id = p_organization_id
AND uom_code = p_uom_code
AND inventory_item_id = p_inventory_item_id;
SELECT uom_code , volume_type, offer_id
FROM ozf_offer_discount_lines
WHERE offer_discount_line_id = p_discount_line_id;
SELECT 1 FROM DUAL WHERE EXISTS (SELECT 1
FROM mtl_units_of_measure_vl
WHERE uom_code = p_uom_code);
select qp_list_header_id into l_list_header_id from ozf_offers where offer_id = l_uom_code.offer_id;
SELECT volume_type FROM ozf_offer_discount_lines
WHERE offer_discount_line_id = p_offer_discount_line_id;
SELECT ozf_offer_discount_products_s.NEXTVAL
FROM dual;
SELECT 1
FROM OZF_OFFER_DISCOUNT_PRODUCTS
WHERE OFF_DISCOUNT_PRODUCT_ID = l_id;
Ozf_Create_Ozf_Prod_Line_Pkg.Insert_Row(
px_off_discount_product_id => l_vo_prod_id,
p_parent_off_disc_prod_id => l_vo_prod_rec.parent_off_disc_prod_id,
p_product_level => l_vo_prod_rec.product_level,
p_product_id => l_vo_prod_rec.product_id,
p_excluder_flag => l_vo_prod_rec.excluder_flag,
p_uom_code => l_vo_prod_rec.uom_code,
p_start_date_active => l_vo_prod_rec.start_date_active,
p_end_date_active => l_vo_prod_rec.end_date_active,
p_offer_discount_line_id => l_vo_prod_rec.offer_discount_line_id,
p_offer_id => l_vo_prod_rec.offer_id,
p_creation_date => SYSDATE,
p_created_by => FND_GLOBAL.USER_ID,
p_last_update_date => SYSDATE,
p_last_updated_by => FND_GLOBAL.USER_ID,
p_last_update_login => FND_GLOBAL.conc_login_id,
p_product_context => l_vo_prod_rec.product_context,
p_product_attribute => l_vo_prod_rec.product_attribute,
p_product_attr_value => l_vo_prod_rec.product_attr_value,
p_apply_discount_flag => l_vo_prod_rec.apply_discount_flag,
p_include_volume_flag => l_vo_prod_rec.include_volume_flag,
px_object_version_number => l_object_version_number
);
PROCEDURE Update_vo_Product(
p_api_version_number IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_vo_prod_rec IN vo_prod_rec_type
)
IS
CURSOR c_get_vo_prod_line(p_offer_prod_id NUMBER, p_object_version_number NUMBER) IS
SELECT *
FROM OZF_OFFER_DISCOUNT_PRODUCTS
WHERE OFF_DISCOUNT_PRODUCT_ID = p_offer_prod_id
AND object_version_number = p_object_version_number;
l_api_name CONSTANT VARCHAR2(30) := 'Update_vo_Product';
SAVEPOINT update_vo_prod_pvt;
OZF_Offer_Adj_Line_PVT.debug_message('Private API: - Open Cursor to Select');
OZF_Utility_PVT.Error_Message(p_message_name => 'API_MISSING_UPDATE_TARGET'
, p_token_name => 'INFO'
, p_token_value => 'VO_PRODUCT_LINE') ;
, p_token_value => 'Last_Update_Date') ;
, p_validation_mode => JTF_PLSQL_API.g_update
, x_return_status => x_return_status
, x_msg_count => x_msg_count
, x_msg_data => x_msg_data
);
OZF_Create_Ozf_Prod_Line_PKG.Update_Row(
p_off_discount_product_id => p_vo_prod_rec.off_discount_product_id,
p_parent_off_disc_prod_id => p_vo_prod_rec.parent_off_disc_prod_id,
p_product_level => p_vo_prod_rec.product_level,
p_product_id => p_vo_prod_rec.product_id,
p_excluder_flag => p_vo_prod_rec.excluder_flag,
p_uom_code => p_vo_prod_rec.uom_code,
p_start_date_active => p_vo_prod_rec.start_date_active,
p_end_date_active => p_vo_prod_rec.end_date_active,
p_offer_discount_line_id => p_vo_prod_rec.offer_discount_line_id,
p_offer_id => p_vo_prod_rec.offer_id,
p_last_update_date => SYSDATE,
p_last_updated_by => FND_GLOBAL.USER_ID,
p_last_update_login => FND_GLOBAL.conc_login_id,
p_product_context => p_vo_prod_rec.product_context,
p_product_attribute => p_vo_prod_rec.product_attribute,
p_product_attr_value => p_vo_prod_rec.product_attr_value,
p_apply_discount_flag => p_vo_prod_rec.apply_discount_flag,
p_include_volume_flag => p_vo_prod_rec.include_volume_flag,
p_object_version_number => p_vo_prod_rec.object_version_number
);
ROLLBACK TO update_vo_prod_pvt;
ROLLBACK TO update_vo_prod_pvt;
ROLLBACK TO update_vo_prod_pvt;
END Update_vo_Product;
PROCEDURE Delete_vo_Product(
p_api_version_number IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_off_discount_product_id IN NUMBER,
p_object_version_number IN NUMBER
)
IS
L_API_NAME CONSTANT VARCHAR2(30) := 'Delete_vo_Product';
SAVEPOINT Delete_vo_Product_PVT;
OZF_Create_Ozf_Prod_Line_PKG.Delete_row(
p_off_discount_product_id => p_off_discount_product_id
, p_object_version_number => p_object_version_number
);
ROLLBACK TO Delete_vo_Product_PVT;
ROLLBACK TO Delete_vo_Product_PVT;
ROLLBACK TO Delete_vo_Product_PVT;
END Delete_vo_Product;