The following lines contain the word 'select', 'insert', 'update' or 'delete':
g_checkrun_name ap_selected_invoices_all.checkrun_name%TYPE;
g_checkrun_id ap_selected_invoices_all.checkrun_id%TYPE;
select org_id
into g_org_id
from ap_selected_invoices_all
where checkrun_id = g_checkrun_id
and rownum < 2;
DELETE FROM fv_ap_cash_pos_temp
WHERE checkrun_id = g_checkrun_id
AND set_of_books_id = g_set_of_books_id
AND org_id = g_org_id;
FV_UTILITY.LOG_MESG(FND_LOG.LEVEL_ERROR, l_module_name,'The pooled flag is not selected on the bank account '||g_bank_acct_name||'.');
DELETE FROM fv_ap_cash_pos_temp
WHERE checkrun_id = g_checkrun_id
AND set_of_books_id = g_set_of_books_id
AND org_id = g_org_id;
SELECT flex_value_set_id
FROM fnd_id_flex_segments
WHERE application_id = p_apps_id
AND id_flex_code = p_flex_code
AND id_flex_num = p_flex_num
AND segment_num = p_acct_segment_num ;
SELECT ussgl_account
FROM fv_facts_ussgl_accounts
WHERE cash_position_flag = 'Y'
AND ussgl_enabled_flag = 'Y';
SELECT 1
FROM fnd_flex_values
WHERE flex_value_set_id = p_value_set_id
AND flex_value = p_acct ;
SELECT check_date,checkrun_name
FROM ap_inv_selection_criteria_all
WHERE checkrun_id = p_checkrun_id;
SELECT count(asi.invoice_num||asi.vendor_id||asi.vendor_site_id) count
FROM ap_selected_invoices_all asi
WHERE asi.checkrun_id = p_checkrun_id;
SELECT cba.pooled_flag, cba.bank_account_name
FROM ce_bank_accounts cba ,
Ce_bank_acct_uses_all cbaua,
ap_inv_selection_criteria_all apis
WHERE apis.checkrun_id = p_checkrun_id
---;)-- AND apis.bank_account_id = cbaua.bank_account_id
SELECT NVL(liability_post_lookup_code ,'None')
FROM ap_system_parameters;
g_error_buf := 'No Invoices were selected for this Payment Batch.';
SELECT gps.period_num,gps.period_year,glpv.currency_CODE
FROM gl_period_statuses gps ,gl_ledgers_public_v glpv
WHERE Start_date <= p_checkrun_date
AND end_date >= p_checkrun_date
AND gps.application_id = p_apps_id
AND gps.set_of_books_id =p_set_of_books_id
AND gps.set_of_books_id = glpv.ledger_id
AND gps.adjustment_period_flag='N';
SELECT ussgl_account
FROM fv_facts_ussgl_accounts,fnd_flex_values
WHERE flex_value_set_id = p_value_set
AND flex_value = ussgl_account
AND cash_position_flag = 'Y'
AND ussgl_enabled_flag = 'Y';
SELECT asi.invoice_num,
asi.invoice_date,
apd.distribution_line_number,
apd.dist_code_combination_id dist_code_combination_id,
((asi.payment_amount) *(apd.amount/asi.invoice_amount)) amount,
asi.vendor_id,
asi.vendor_site_id
FROM ap_selected_invoices asi,
ap_invoice_distributions apd
WHERE asi.checkrun_id = p_checkrun_id
AND apd.invoice_id = asi.invoice_id
ORDER by asi.invoice_num;
SELECT fund,gl_cash_balance
FROM fv_ap_cash_pos_temp
WHERE checkrun_id = p_checkrun_id
AND fund = p_fund
AND set_of_books_id = p_sob_id
AND org_id = p_org_id
AND rownum = 1;
l_bal_select VARCHAR2(5000) ;
l_bal_select :=
'SELECT SUM((GLB.BEGIN_BALANCE_DR -
GLB.BEGIN_BALANCE_CR) + (GLB.PERIOD_NET_DR - PERIOD_NET_CR )) '||
' FROM GL_BALANCES GLB,' ||
' GL_CODE_COMBINATIONS GLCC' ||
' WHERE GLB.code_combination_id = GLCC.code_combination_id ' ||
' AND '||'glb.actual_flag = '|| '''' || 'A' || '''' ||
' AND GLCC.'|| g_bal_segment_name ||' = '||'''' || l_acct_dist_tbl(g_bal_segment_num) ||''''||
' AND ((GLCC.' ||g_acct_segment_name ||' = :l_cash_ussgl_acct ' ||
' ) OR GLCC.'||g_acct_segment_name ||' IN (SELECT flex_value '||
'FROM fnd_flex_values ffv, fnd_flex_value_hierarchies ffvh '||
'WHERE ffv.flex_value BETWEEN ffvh.child_flex_value_low
AND ffvh.child_flex_value_high
AND ffv.flex_value_set_id = :g_value_set_id AND ffv.flex_value_set_id = ffvh.flex_value_set_id'||
' AND parent_flex_value = :l_cash_ussgl_acct)) AND GLB.period_year = :l_period_year AND GLB.period_num = :l_period_num AND GLB.LEDGER_ID = :g_set_of_books_id AND glb.currency_code = :l_currency_code';
IBY_PAYMENT_FORMAT_VAL_PVT.log_error_messages(FND_LOG.LEVEL_STATEMENT, l_module_name, l_bal_select);
DBMS_SQL.PARSE(l_bal_cursor, l_bal_select, DBMS_SQL.V7) ;
INSERT INTO fv_ap_cash_pos_temp
(checkrun_id,
checkrun_name, --bug 5564904
check_date,
fund,
invoice_num,
invoice_date,
distribution_line_number,
amount,
vendor_id,
vendor_site_id,
gl_cash_balance,
set_of_books_id,
org_id )
VALUES
(g_checkrun_id,
g_checkrun_name, --bug 5564904
g_check_date,
l_acct_dist_tbl(g_bal_segment_num),
vcheck_rec.invoice_num,
vcheck_rec.invoice_date,
vcheck_rec.distribution_line_number,
vcheck_rec.amount,
vcheck_rec.vendor_id,
vcheck_rec.vendor_site_id,
l_tot_cash_balance,
g_set_of_books_id,
g_org_id);
SELECT chart_of_accounts_id
FROM gl_ledgers_public_v
WHERE ledger_id = p_set_of_books_id;