The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT min(trx_number)
from igi_stp_candidates
where stp_id = p_stp_id
and application = p_application
and user_id = x_user_id
and currency_code = x_currency_code ;
SELECT max(trx_number)
from igi_stp_candidates
where stp_id = p_stp_id
and application = p_application
and user_id = x_user_id
and currency_code = x_currency_code;
SELECT min(a.reference)
from igi_stp_candidates a
where a.stp_id = x_vendor_id
and a.application = 'AP'
and a.user_id = x_user_id
and a.currency_code = x_currency_code
and a.reference in ( select b.reference from igi_stp_candidates b
where b.stp_id = x_customer_id
and b.application = 'AR'
and b.user_id = x_user_id
and b.currency_code = x_currency_code);
SELECT max(a.reference)
from igi_stp_candidates a
where a.stp_id = x_vendor_id
and a.application = 'AP'
and a.user_id = x_user_id
and a.currency_code = x_currency_code
and a.reference in ( select b.reference from igi_stp_candidates b
where b.stp_id = x_customer_id
and b.application = 'AR'
and b.user_id = x_user_id
and b.currency_code = x_currency_code);
SELECT distinct p.reference
FROM igi_stp_candidates p
WHERE p.application = 'AP'
AND p.user_id = x_user_id
AND p.stp_id = x_vendor_id
AND p.currency_code = x_currency_code
AND p.reference >= nvl(p_ref_min, l_ref_min)
AND p.reference <= nvl(p_ref_max, l_ref_max)
AND p.reference IN (SELECT distinct r.reference
FROM igi_stp_candidates r
WHERE application = 'AR'
AND r.user_id = x_user_id
AND r.stp_id = x_customer_id
AND r.currency_code = x_currency_code
AND r.reference >= nvl(p_ref_min, l_ref_min)
AND r.reference <= nvl(p_ref_max, l_ref_max)); */
/* Depending on the Netting Type only certain documents are selected either AP and AR, AP or AR */
UPDATE igi_stp_candidates
SET process_flag = 'R'
WHERE user_id = x_user_id
and stp_id in (x_customer_id, x_vendor_id)
and currency_code = x_currency_code;
UPDATE igi_stp_candidates
SET process_flag = 'A'
WHERE user_id = x_user_id
and stp_id = x_vendor_id
and currency_code = x_currency_code
and application = 'AP'
and trx_type = 'STANDARD'
and trx_number >= nvl(x_ap_trx_min, v_ap_trx_min)
and trx_number <= nvl(x_ap_trx_max, v_ap_trx_max)
and process_flag = 'R';
UPDATE igi_stp_candidates
SET process_flag = 'A'
WHERE user_id = x_user_id
and stp_id = x_customer_id
and currency_code = x_currency_code
and application = 'AR'
and trx_type = 'INV'
and trx_number >= nvl(x_ar_trx_min, v_ar_trx_min)
and trx_number <= nvl(x_ar_trx_max, v_ar_trx_max)
and process_flag = 'R';
UPDATE igi_stp_candidates
SET process_flag = 'A'
-- Bug 1322996
-- SET process_flag = 'S'
-- , package_num = x_counter
WHERE user_id = x_user_id
and currency_code = x_currency_code
and stp_id in ( x_customer_id, x_vendor_id)
and trx_type in ('STANDARD', 'INV')
and reference = rec_match.reference
and process_flag = 'R';
UPDATE igi_stp_candidates
SET process_flag = 'A'
WHERE user_id = x_user_id
and stp_id = x_vendor_id
and currency_code = x_currency_code
and application = 'AP'
and trx_type = decode(x_type, 6,'CREDIT', 'STANDARD')
and trx_number >= nvl(x_ap_trx_min, v_ap_trx_min)
and trx_number <= nvl(x_ap_trx_max, v_ap_trx_max)
and process_flag = 'R';
UPDATE igi_stp_candidates
SET process_flag = 'A'
WHERE user_id = x_user_id
and stp_id = x_customer_id
and currency_code = x_currency_code
and application = 'AR'
and trx_type = 'CM'
and trx_number >= nvl(x_ar_trx_min, v_ar_trx_min)
and trx_number <= nvl(x_ar_trx_max, v_ar_trx_max)
and process_flag = 'R';
PROCEDURE Update_Candidates (x_type VARCHAR2,
x_batch_id NUMBER,
x_package_id NUMBER,
x_org_id number) is
x_user_id NUMBER := fnd_global.user_id;
UPDATE igi_stp_candidates_all
SET batch_id = x_batch_id
, netting_trx_type_id = x_type
, package_id = x_package_id
WHERE user_id = x_user_id
AND process_flag = 'S'
AND batch_id = -1
AND org_id = x_org_id;
END Update_Candidates;