The following lines contain the word 'select', 'insert', 'update' or 'delete':
UPDATE AP_PAYMENT_SCHEDULES
SET GLOBAL_ATTRIBUTE1 = v_inttyp,
GLOBAL_ATTRIBUTE2 = v_intamt,
GLOBAL_ATTRIBUTE3 = v_intprd,
GLOBAL_ATTRIBUTE4 = v_intfml,
GLOBAL_ATTRIBUTE5 = v_intgrd,
GLOBAL_ATTRIBUTE6 = v_pnttyp,
GLOBAL_ATTRIBUTE7 = v_pntamt,
GLOBAL_ATTRIBUTE8 = 'N',
GLOBAL_ATTRIBUTE_CATEGORY = v_glbattctg
WHERE INVOICE_ID = P_Invoice_ID;
SELECT due_date, discount_date, payment_num
FROM ap_payment_schedules
WHERE invoice_id = P_Invoice_ID;
UPDATE ap_payment_schedules
SET due_date = to_date(l_new_date_char,'DD-MM-YYYY')
WHERE invoice_id = P_Invoice_ID
AND payment_num = db_reg.payment_num;
UPDATE ap_payment_schedules
SET discount_date = to_date(l_new_date_char ,'DD-MM-YYYY')
WHERE invoice_id = P_Invoice_ID
AND payment_num = db_reg.payment_num ;
UPDATE ap_payment_schedules
SET global_attribute11 = s_bank_collection_id
WHERE invoice_id = P_Invoice_ID
AND payment_num = db_reg.payment_num;
SELECT vendor_site_id, invoice_type_lookup_code, substr(global_attribute1,1,1)
INTO v_vndstid, l_invoice_type_lookup_code, s_colldoc_assoc
FROM ap_invoices
WHERE invoice_id = P_Invoice_ID;
Select jl.our_number
From jl_br_ap_collection_docs jl
,ap_payment_schedules_all ap
,iby_docs_payable_all iby
Where iby.document_payable_id = P_Doc_Payable_ID
And iby.calling_app_doc_unique_ref2 = ap.invoice_id
And iby.calling_app_doc_unique_ref3 = ap.payment_num
And jl.bank_collection_id = ap.global_attribute11;
SELECT pays.process_type
FROM iby_payments_all pays
,iby_docs_payable_all docs
WHERE pays.payment_id = docs.payment_id
AND docs.document_payable_id = P_Doc_Payable_ID;
select sum(nvl(int.invoice_amount,0))
into int_amt
from ap_invoices_all int,
ap_invoice_relationships rel,
iby_docs_payable_all iby
where rel.original_invoice_id = iby.calling_app_doc_unique_ref2 -- ap.invoice_id
and rel.original_payment_num = iby.calling_app_doc_unique_ref3 -- ap.payment_num
and int.invoice_id = rel.related_invoice_id
and iby.document_payable_id = P_Doc_Payable_ID;
SELECT sum(nvl(invoice_amount,0))
INTO int_amt
FROM ap_selected_invoices_all ap,
iby_docs_payable_all iby
WHERE original_invoice_id = iby.calling_app_doc_unique_ref2 -- :invoice_id
AND original_payment_num = iby.calling_app_doc_unique_ref3 -- :payment_num
AND iby.document_payable_id = P_Doc_Payable_ID;
SELECT pays.process_type
FROM iby_payments_all pays
,iby_docs_payable_all docs
WHERE pays.payment_id = docs.payment_id
AND docs.document_payable_id = P_Doc_Payable_ID;
SELECT abs(sum(nvl(aid.amount,0)))
INTO abate
FROM ap_invoice_distributions_all aid,
ap_invoice_payments_all aip,
ap_checks_all ac,
iby_docs_payable_all iby
WHERE aid.invoice_id = aip.invoice_id
AND ac.check_number = iby.payment_id -- :check_number
AND ac.check_id = aip.check_id
AND aid.parent_invoice_id = iby.calling_app_doc_unique_ref2 -- :invoice_id
AND iby.document_payable_id = P_Doc_Payable_ID;
SELECT abs(sum(nvl(aid.amount,0)))
INTO abate
FROM ap_invoice_distributions_all aid,
ap_selected_invoices_all asi,
iby_docs_payable_all iby,
iby_pay_service_requests proc,
iby_payments_all paym
WHERE aid.invoice_id = asi.invoice_id
AND asi.checkrun_name = proc.call_app_pay_service_req_code -- :p_payment_batch
AND paym.payment_service_request_id = proc.payment_service_request_id
AND iby.payment_id = paym.payment_id
AND asi.ok_to_pay_flag <> 'N'
AND aid.parent_invoice_id = iby.calling_app_doc_unique_ref2 -- :invoice_id
AND aid.parent_invoice_id <> aid.invoice_id -- fix for bug 2676773
AND iby.calling_app_id= 200
AND iby.document_payable_id = P_Doc_Payable_ID;
SELECT 1 br_c
FROM ap_invoices_all ap,
iby_docs_payable_all iby
WHERE ap.invoice_id = iby.calling_app_doc_unique_ref2
AND ap.global_attribute_category = 'JL.BR.APXINWKB.AP_INVOICES'
AND iby.document_payable_id = P_Doc_Payable_ID;