Home » Applications » Oracle Fusion Apps & E-Business Suite » Equivalent SQL query from R11 to R12
Equivalent SQL query from R11 to R12 [message #462134] |
Tue, 22 June 2010 22:24 |
xhyrruz
Messages: 14 Registered: June 2010 Location: Philippines
|
Junior Member |
|
|
Hi Everyone,
Anyone help me to convert the query below from R11 to R12. Some tables in R11 were changed in R12.
SQL Query 1:
select a.check_id, a.bank_account_id,upper(nvl(a.attribute3,a.vendor_name)) cv_pay_to,
to_char(a.creation_date,'FMMONTH DD, YYYY') cv_date,
a.doc_sequence_value cv_number,
'*'||ltrim(to_char(a.amount,'999,999,990.90')) ||'*' cv_net_amount,
'**'||apps.kcc_amt_to_words(a.amount,a.currency_code) ||'**' cv_pesos,
a.current_bank_account_name cv_bank_name,
a.check_number cv_check_number,
case when a.future_pay_due_date is null then
a.check_date
else
a.future_pay_due_date
end cv_check_date,
b.invoice_num, b.invoice_date, b.description invoice_desc
from apps.ap_checks_v a, apps.ap_invoice_payments_v b
where a.bank_account_id = :p_bank_acctno
and a.status_lookup_code <> 'VOIDED'
and a.check_number between :p_chk_number and :p_to_chk_number
and a.check_id=b.check_id(+)
SQL Query 2:
select check_id, account, description, sum(debit) debit, sum(credit) credit
from
(select a.check_id,
c.segment2||'-'||c.segment3 account,
d.description,
a.amount debit,
null credit
from apps.ap_invoice_payments_v a, apps.ap_invoices_v b, apps.gl_code_combinations c, apps.fnd_flex_values_vl d
where b.invoice_id = a.invoice_id
and c.code_combination_id = b.accts_pay_code_combination_id
and d.flex_value = c.segment2
and d.flex_value_set_id = 1007699
union all
select a.check_id,
d.segment2||'-'||d.segment3 account,
e.description,
null debit,
b.amount_withheld credit
from apps.ap_invoice_payments_v a, apps.ap_invoices_v b, apps.ap_tax_codes c, apps.gl_code_combinations d, apps.fnd_flex_values_vl e
where a.invoice_id = b.invoice_id
and c.name = b.awt_group_name
and d.code_combination_id = c.tax_code_combination_id
and e.flex_value = d.segment2
and e.flex_value_set_id = 1007699
union all
select a.check_id,
d.segment2||'-'||d.segment3 account,
e.description,
null debit, c.amount credit
from apps.ap_checks_v a, apps.ap_bank_accounts b, apps.ap_invoice_payments c, apps.gl_code_combinations d, apps.fnd_flex_values_vl e
where b.bank_account_id = a.bank_account_id
and c.check_id = a.check_id
and d.code_combination_id = b.cash_clearing_ccid
and e.flex_value = d.segment2
and e.flex_value_set_id = 1007699)
group by check_id, description, account
order by debit, account, description
Any help appreciated.
Thanks.
Cyrus
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Jan 11 05:12:36 CST 2025
|