The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 'exists'
into l_exists
from ap_income_tax_regions
where sysdate < nvl(inactive_date, sysdate+1)
and region_short_name = vsstate;
select 'exists'
into l_exists
from hz_geographies geo
where geo.country_code = 'BR'
and nvl(start_date, sysdate) <= sysdate
and nvl(end_date, sysdate) >= sysdate
and geo.geography_type = 'STATE'
and geo.geography_code = vsstate;
select substr(description,1,30)
into vdesc
from fnd_descr_flex_contexts_vl
where application_id = 7003
and descriptive_flexfield_name = 'JG_AP_SYSTEM_PARAMETERS'
and descriptive_flex_context_code = 'JL.BR.APXCUMSP.SYS_PARAMETER'
and enabled_flag = 'Y' and rownum = row_number;
SELECT L.LOOKUP_CODE
Into inttyp
FROM FND_LOOKUPS L,PO_VENDOR_SITES V
WHERE L.LOOKUP_CODE = V.GLOBAL_ATTRIBUTE2
AND L.LOOKUP_TYPE = 'JLBR_INTEREST_PENALTY_TYPE'
AND V.VENDOR_SITE_ID = vndstid and rownum = row_number;
SELECT GLOBAL_ATTRIBUTE8, GLOBAL_ATTRIBUTE6,
GLOBAL_ATTRIBUTE4, GLOBAL_ATTRIBUTE3
INTO pntamt, intgrd, intprd, intamt
FROM PO_VENDOR_SITES
WHERE VENDOR_SITE_ID = vndstid and rownum = row_number;
SELECT L.LOOKUP_CODE
INTO intfml
FROM FND_LOOKUPS L, PO_VENDOR_SITES V
WHERE L.LOOKUP_CODE = V.GLOBAL_ATTRIBUTE5
AND L.LOOKUP_TYPE = 'JLBR_INTEREST_FORMULA'
AND V.VENDOR_SITE_ID = vndstid and rownum = row_number;
SELECT L.LOOKUP_CODE
INTO pnttyp
FROM FND_LOOKUPS L, PO_VENDOR_SITES V
WHERE L.LOOKUP_CODE = V.GLOBAL_ATTRIBUTE7
AND L.LOOKUP_TYPE = 'JLBR_INTEREST_PENALTY_TYPE'
AND V.VENDOR_SITE_ID = vndstid and rownum = row_number;
SELECT substr(global_attribute10,1,38)
INTO cons_inv_num
FROM ap_invoices
WHERE invoice_id = invoiceid and rownum = row_number;
select payment_status_flag
into pay_stat
from ap_invoices
where invoice_id = invoiceid and rownum = row_number;
select count(*)
into tot_recs
from ap_payment_schedules
where invoice_id = invoiceid
and global_attribute11 is not null;
select code_combination_id
into ccid
from po_distributions_ap2_v
where line_location_id = line_locn_id
and rownum < 2 ;
select decode(account_type,'A','Y','N')
Into account_type
from gl_code_combinations
where code_combination_id = ccid and rownum = row_number;
select tax_code_combination_id
Into ccid
from ap_tax_codes
where name = tax_name
and nvl(start_date,p_val_date) <= p_val_date
and nvl(inactive_date,p_val_date+1) > p_val_date
and nvl(enabled_flag,'Y') = 'Y';
select to_number(global_attribute2)
Into ccid
from hr_locations_all
where location_id = locn_id and rownum = row_number;
select nvl(max(distribution_line_number),0)
into max_dist_line_num
from ap_invoice_distributions
where invoice_id = invoiceid
-- Commented out as unnecessary - iswillia (08-OCT-1999)
--and rownum = row_number
-- End of Commented out portion - iswillia (08-OCT-1999)
;
SELECT po_distribution_id
INTO distid
FROM po_distributions_ap2_v
WHERE line_location_id = line_locn_id
AND rownum < 2 ;
SELECT ap_invoice_distributions_s.nextval
INTO l_invoice_distribution_id
FROM dual;
p_last_update_date IN OUT NOCOPY Date,
p_Last_Updated_By IN OUT NOCOPY number,
p_Set_Of_Books_Id IN OUT NOCOPY number,
p_Type_1099 IN OUT NOCOPY varchar2,
p_Last_Update_Login IN OUT NOCOPY number,
p_Creation_Date IN OUT NOCOPY Date,
p_Created_By IN OUT NOCOPY number,
p_exchange_rate IN OUT NOCOPY Number,
p_exchange_rate_type IN OUT NOCOPY Varchar2,
p_exchange_date IN OUT NOCOPY Date,
p_invoice_amount_limit IN OUT NOCOPY number,
p_amount_hold_flag IN OUT NOCOPY varchar2,
p_cfo_code IN OUT NOCOPY varchar2
) IS
l_last_update_date Date;
l_Last_Updated_By number;
l_Last_Update_Login number;
SELECT set_of_books_id,
type_1099,
exchange_rate,
exchange_rate_type,
exchange_date,
invoice_amount_limit,
substr(amount_hold_flag,1,1),
rtrim(substr(global_attribute2,1,5)),
last_update_date,
last_Updated_By,
last_Update_Login,
creation_date,
created_by
INTO l_Set_Of_Books_Id,
l_Type_1099,
l_exchange_rate ,
l_exchange_rate_type ,
l_exchange_date,
l_invoice_amount_limit,
l_amount_hold_flag ,
l_cfo_code,
l_last_update_date ,
l_last_Updated_By ,
l_last_Update_Login ,
l_creation_date,
l_created_by
FROM ap_invoices_v
where invoice_id = P_Invoice_id;
p_last_update_date := l_last_update_date;
p_last_Updated_By := l_last_updated_by;
p_last_Update_Login := l_last_update_login;
SELECT count(*)
Into tot_rec
FROM ap_invoice_distributions
WHERE invoice_id = invoiceid
AND line_type_lookup_code IN ('ICMS','IPI');
select state ship_from
into shp_frm
from po_vendor_sites
where vendor_site_id = vendsite_id
and nvl(inactive_date,sysdate + 1) > sysdate and rownum = row_number;
select substr(region_2,1,30)
into shp_to
from hr_locations_all
where location_id = locn_id and rownum = row_number;
select tax_rate_differential
into tax_flag
from jl_br_ap_operations
where cfo_code = cfocd and rownum = row_number;
SELECT transaction_reason_code, substr(global_attribute1,1,15)
INTO trans_reason_code, fiscal_class_code
FROM po_lines
WHERE po_line_id = polineid and rownum = row_number;
SELECT ship_to_organization_id
INTO inv_org_id
FROM po_line_locations
Where po_line_id = p_po_line_id ;
SELECT inventory_organization_id
INTO inv_org_id
FROM financials_system_parameters Where rownum = row_number;
select substr(Global_Attribute3,1,25)
into asson_method
from ap_System_Parameters Where rownum = row_number;
select ATC.tax_code_combination_id,
to_number(substr(ATC.global_attribute1,1,15)),
ATC.description,
decode(GL.account_type,'A','Y','N')
into tcc_id1, tcc_id2, description, account_type
from ap_tax_codes ATC, gl_code_combinations GL
where ATC.name = vatcode
and ATC.tax_code_combination_id = GL.code_combination_id
and nvl(ATC.inactive_date,sysdate + 1) > sysdate and rownum = row_number;
SELECT count(*)
Into tot_rec
FROM ap_invoice_distributions
WHERE invoice_id = invoiceid
AND line_type_lookup_code = 'ITEM';
select nvl(tax_recoverable,'N')
into tax_recoverable
from jl_br_ap_operations
where cfo_code = cfocd and rownum = row_number;
select count(*)
into tot_rec
from ap_payment_schedules
where invoice_id = invoiceid;
select count(*)
into tot_rec
from ap_invoice_distributions
where invoice_id = invoiceid
and awt_invoice_id is not null;
select vendor_site_id
into vendsite_id
from ap_invoices
where invoice_id = invoiceid and rownum = row_number;
select substr(global_attribute16,1,25)
into tax_cal_name
from po_vendor_sites
where vendor_site_id = vendsite_id
and nvl(inactive_date,sysdate + 1) > sysdate and rownum = row_number;
select substr(global_attribute2,1,25)
into tax_type
from ap_tax_codes
where tax_id = tax_code_id
and nvl(inactive_date,sysdate + 1) > sysdate and rownum = row_number;
select base_date
Into basedt
from jl_br_ap_tax_calendar_headers
where tax_calendar_name = taxcal_name
and tax_type = taxtype and rownum = row_number;
select j.due_date
into duedt
from jl_br_ap_tax_calendar_lines j, ap_invoices a
where a.invoice_id = invoiceid
and j.tax_calendar_name = taxcal_name
and a.terms_date between j.start_date and j.end_date
and sysdate < nvl(j.inactive_date,sysdate+1) and rownum = row_number;
select j.due_date
into duedt
from jl_br_ap_tax_calendar_lines j, ap_invoices a
where a.invoice_id = invoiceid
and j.tax_calendar_name = taxcal_name
and a.invoice_date between j.start_date and j.end_date
and sysdate < nvl(j.inactive_date,sysdate+1) and rownum = row_number;
select j.due_date
into duedt
from jl_br_ap_tax_calendar_lines j, ap_invoice_distributions a
where a.invoice_id = invoiceid
and j.tax_calendar_name = taxcal_name
and a.accounting_date between j.start_date and j.end_date
and sysdate < nvl(j.inactive_date,sysdate+1) and rownum = row_number;
Select etb.town_or_city
From
xle_establishment_v etb
,xle_bsv_associations bsv
,gl_ledger_le_v gl
Where
etb.legal_entity_id = gl.legal_entity_id
And bsv.legal_parent_id = etb.legal_entity_id
And etb.establishment_id = bsv.legal_construct_id
And bsv.entity_name = l_BSV
And gl.ledger_id = l_ledger_id;
select set_of_books_id,substr(global_attribute4,1,25)
into l_ledger_id,l_BSV
from ap_system_parameters;
select city
into vcity
from po_vendor_sites
where vendor_site_id = vendsite_id
and nvl(inactive_date,sysdate + 1) > sysdate and rownum = row_number;
SELECT COUNT (*)
INTO total_rec
FROM fnd_currencies_vl c
WHERE c.global_attribute1 = cnab
AND c.currency_code <> curr_code;
SELECT SUBSTR (c.global_attribute1, 1, 15)
INTO cnab
FROM fnd_currencies_vl c
WHERE c.currency_code = curr_code
AND rownum = row_number;
select tax_id
into p_tax_id
from AP_TAX_CODES
where name = p_tax_name
and nvl(start_date,p_val_date) <= p_val_date
and nvl(inactive_date,p_val_date+1) > p_val_date
and nvl(enabled_flag,'Y') = 'Y';
Select etb.town_or_city, etb.region_2
From
xle_establishment_v etb
,xle_bsv_associations bsv
,gl_ledger_le_v gl
Where
etb.legal_entity_id = gl.legal_entity_id
And bsv.legal_parent_id = etb.legal_entity_id
And etb.establishment_id = bsv.legal_construct_id
And bsv.entity_name = l_BSV
And gl.ledger_id = l_ledger_id;
select set_of_books_id,substr(global_attribute4,1,25)
into l_ledger_id,l_BSV
from ap_system_parameters;
select city,
state --Bug # 2319552
into vcity,
vstate --Bug # 2319552
from po_vendor_sites
where vendor_site_id = vendsite_id
and nvl(inactive_date,sysdate + 1) > sysdate and rownum = row_number;
select vendor_id
into vendor_id
from ap_invoices
where invoice_id = invoiceid and rownum = row_number;
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 = v_invid;
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 = v_invid
AND PAYMENT_NUM = v_pmtno;
UPDATE AP_PAYMENT_SCHEDULES
set due_date = to_date (l_due_date_char,'YYYY/MM/DD HH24:MI:SS')
where invoice_id = l_invoice_id
and payment_num = l_payment_num;
UPDATE AP_PAYMENT_SCHEDULES
SET discount_date = to_date (l_discount_date_char,'YYYY/MM/DD HH24:MI:SS')
WHERE invoice_id = l_invoice_id
AND payment_num = l_payment_num;
UPDATE AP_PAYMENT_SCHEDULES
SET due_date = to_date (l_due_date_char,'YYYY/MM/DD HH24:MI:SS')
where invoice_id = l_new_invoice_id;
UPDATE AP_PAYMENT_SCHEDULES
SET due_date = l_new_date1
WHERE invoice_id = s_invoice_id
AND payment_num = s_payment_num;
UPDATE AP_PAYMENT_SCHEDULES
SET discount_date = l_new_date1
WHERE invoice_id = s_invoice_id
AND payment_num = s_payment_num;
UPDATE AP_PAYMENT_SCHEDULES
set global_attribute11 = s_bank_collection_id
where invoice_id = s_invoice_id
and payment_num = s_payment_num;