The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT org_id
FROM ozf_resale_batches_all
WHERE resale_batch_id = p_id;
SELECT *
FROM ozf_resale_lines_int
WHERE status_code =OZF_RESALE_COMMON_PVT.G_BATCH_ADJ_OPEN
AND resale_batch_id = p_id;
SELECT NVL(batch_count,0)
FROM ozf_resale_batches
WHERE resale_batch_id = pc_batch_id;
SELECT count(1)
FROM ozf_resale_lines_int
WHERE status_code = OZF_RESALE_COMMON_PVT.G_BATCH_ADJ_DUPLICATED
AND resale_batch_id = p_id;
SELECT count(1)
FROM ozf_resale_lines_int
WHERE status_code = OZF_RESALE_COMMON_PVT.G_BATCH_ADJ_DISPUTED
AND resale_batch_id = p_id;
DELETE FROM ozf_resale_logs_all
WHERE resale_id_type = 'BATCH'
AND resale_id = p_resale_batch_id;
update ozf_resale_lines_int
set dispute_code = null
where resale_batch_id = p_resale_batch_id
and status_code= OZF_RESALE_COMMON_PVT.G_BATCH_ADJ_OPEN;
update ozf_resale_lines_int
set status_code= OZF_RESALE_COMMON_PVT.G_BATCH_ADJ_PROCESSED
where resale_batch_id = p_resale_batch_id
and status_code= OZF_RESALE_COMMON_PVT.G_BATCH_ADJ_OPEN
and tracing_flag = 'T';
OZF_RESALE_COMMON_PVT.Update_Duplicates (
p_api_version => 1.0,
p_init_msg_list => FND_API.G_FALSE,
p_commit => FND_API.G_FALSE,
p_validation_level => FND_API.G_VALID_LEVEL_FULL,
p_resale_batch_id => p_resale_batch_id,
p_resale_batch_type => l_batch_type,
p_batch_status => l_batch_status,
x_batch_status => l_batch_status,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
update ozf_resale_batches_all
set status_code = OZF_RESALE_COMMON_PVT.G_BATCH_REJECTED
where resale_batch_id = p_resale_batch_id;
SELECT batch_number
FROM ozf_resale_batches
WHERE resale_batch_id = cv_batch_id;
SELECT resale_batch_id
FROM ozf_resale_batches
WHERE report_start_date >= p_start_date
AND report_end_date <= p_end_date
AND status_code = 'CLOSED';
SELECT resale_batch_id
FROM ozf_resale_batches
WHERE report_start_date >= p_start_date
AND report_end_date <= p_end_date
AND partner_cust_account_id = p_cust_account_id
AND status_code = 'CLOSED';
SELECT resale_batch_id
FROM ozf_resale_batches
WHERE partner_cust_account_id = cv_cust_account_id
AND status_code = 'CLOSED';
UPDATE ozf_resale_batches_all
SET status_code = OZF_RESALE_COMMON_PVT.G_BATCH_CLOSED
WHERE resale_batch_id = l_batch_id_tbl(j);
UPDATE ozf_resale_batches_all
SET status_code = OZF_RESALE_COMMON_PVT.G_BATCH_PENDING_ACCRUALS
WHERE resale_batch_id = l_batch_id_tbl(j);
l_budget_data := DBMS_XMLGEN.getXml('SELECT ''FUND'' AccrualType,
util.utilization_id UtilizationId,
util.fund_id FundId,
NVL(map.xref_line_id_value,oe.list_line_id) DiscountLineId,
util.product_id ProductId,
line.resale_header_id OrderId,
line.resale_line_id OrderLineId,
line.quantity ShippedQuantity,
(line.quantity*NVL(line.selling_price,line.purchase_price)) Revenue,
NVL(util.plan_curr_amount,0) AccrualAmount
FROM ozf_resale_lines_all line, ozf_funds_utilized_all_b util,
ozf_offers off, ozf_resale_adjustments_all oe,
ozf_xref_map map
WHERE line.resale_line_id = util.object_id
AND util.object_type = ''TP_ORDER''
AND util.request_id = fnd_global.conc_request_id
AND util.plan_type = ''OFFR''
AND util.plan_id = off.qp_list_header_id
AND util.price_adjustment_id = oe.resale_adjustment_id
AND util.gl_posted_flag IN (''Y'', ''X'')
AND oe.list_line_id = map.list_line_id(+)
AND NVL(off.budget_offer_yn, ''N'') = ''Y''', 0);
l_offer_data := DBMS_XMLGEN.getXml('SELECT ''OFFR'' AccrualType,
util.utilization_id UtilizationId,
util.plan_id PromotionId,
util.fund_id FundId,
NVL(map.xref_line_id_value,oe.list_line_id) DiscountLineId,
util.product_id ProductId,
line.resale_header_id OrderId,
line.resale_line_id OrderLineId,
util.cust_account_id CustomerId,
line.quantity ShippedQuantity,
(line.quantity*NVL(line.selling_price,line.purchase_price)) Revenue,
NVL(util.plan_curr_amount,0) AccrualAmount
FROM ozf_resale_lines_all line, ozf_funds_utilized_all_b util,
ozf_offers off, ozf_resale_adjustments_all oe,
ozf_xref_map map
WHERE line.resale_line_id = util.object_id
AND util.object_type = ''TP_ORDER''
AND util.request_id = fnd_global.conc_request_id
AND util.plan_type = ''OFFR''
AND util.plan_id = off.qp_list_header_id
AND util.price_adjustment_id = oe.resale_adjustment_id
AND util.gl_posted_flag = ''Y''
AND oe.list_line_id = map.list_line_id(+)
AND NVL(off.budget_offer_yn, ''N'') = ''N''', 0);
DELETE FROM ozf_resale_lines_int_all a
WHERE a.resale_batch_id IN (
SELECT b.resale_batch_id
FROM ozf_resale_batches b
WHERE b.purge_flag IS NULL
AND b.status_code = 'CLOSED'
);
UPDATE ozf_resale_batches
SET purge_flag = 'T'
WHERE purge_flag IS NULL
AND status_code = 'CLOSED';
DELETE FROM ozf_resale_lines_int_all a
WHERE a.data_source_code = p_data_source_code
AND a.resale_batch_id IN (
SELECT b.resale_batch_id
FROM ozf_resale_batches b
WHERE b.purge_flag IS NULL
AND b.status_code = 'CLOSED'
AND b.data_source_code = p_data_source_code
);
UPDATE ozf_resale_batches
SET purge_flag = 'T'
WHERE purge_flag IS NULL
AND status_code = 'CLOSED'
AND data_source_code = p_data_source_code;
DELETE FROM ozf_resale_lines_int_all a
WHERE a.resale_batch_id IN (
SELECT b.resale_batch_id
FROM ozf_resale_batches b
WHERE b.purge_flag IS NULL
AND b.resale_batch_id = p_resale_batch_id
AND b.status_code NOT IN ('CLOSED', 'PROCESSING', 'PENDING_PAYMENT')
);
DELETE FROM ozf_resale_batches_all
WHERE resale_batch_id = p_resale_batch_id
AND status_code NOT IN ('CLOSED', 'PROCESSING', 'PENDING_PAYMENT');
DELETE FROM ozf_resale_lines_int_all a
WHERE a.data_source_code = p_data_source_code
AND a.resale_batch_id IN (
SELECT b.resale_batch_id
FROM ozf_resale_batches b
WHERE b.purge_flag IS NULL
AND b.data_source_code = p_data_source_code
AND b.resale_batch_id = p_resale_batch_id
);
DELETE FROM ozf_resale_batches_all
WHERE resale_batch_id = p_resale_batch_id
AND data_source_code = p_data_source_code
AND status_code NOT IN ('CLOSED', 'PROCESSING', 'PENDING_PAYMENT');