Wednesday, 27 April 2022

Oracle XML Publisher + How to display the numbers start with zero in Excel?

1 comments

If our value is 01234 but in excel it shows 1234 because it converts it into number.

I have item number 006454.123. it is a varchar2 column. when I load it in xml and in output excel it is showing 6454.123

so to display as it is i used below code in form field.

<fo:bidi-override direction="ltr" unicode-bidi="bidi-override">  <?ITEM_NUMBER?></fo:bidi-override>


Your's

Amar ALam

How to display column values in a row in oracle?

2 comments

 SELECT

   deptno,

   RTRIM(xmlagg (xmlelement (e, ename || ',')).extract ('//text()'), ',') enames

FROM emp

GROUP BY deptno;


Your's

Amar Alam

Oracle Apps + How to get year start date and end date based on period name?

1 comments

SELECT 
year_start_date,last_day(add_months(trunc(year_start_date,'YYYY') , 14)) year_end_date
FROM gl_periods
WHERE period_name='MAY-13';


YEAR_START_DATE YEAR_END_DATE
-----------------------------------
01-APR-13 31-MAR-14


Regards,
Amar

Oracle apps + How to display Sequence number in xml publisher?

0 comments

Place the below code in a form field and place that form field after loop.

<?position()?>

It will display the numbers start from one.

Regards,
Amar

Monday, 18 April 2022

Oracle + Check Materialized View last refresh date and Time

9 comments

SELECT

owner,

mview_name,

TO_CHAR(last_refresh_date, 'yyyymmddhh24miss') last_refresh_date

FROM all_mviews

WHERE 1=1

AND owner = 'APPS'

AND mview_name = 'XXVFI_SFDC_BOM_HDR_MV'


Regards,

Amar

Friday, 4 December 2020

Oracle SQL + How to concatenate time to a date

0 comments

1). select to_date ('17-Feb-2019' || ' 23:59:00', 'dd-mon-yyyy hh24:mi:ss') from dual;

2). If you're passing a DATE variable and a STRING below query should works

select to_date ( to_char(DATE_VARIABLE, 'dd-mon-yyyy') || ' 23:59:00', 'dd-mon-yyyy hh24:mi:ss') from( select to_date('17-Feb-2019', 'dd-mon-yyyy') as DATE_VARIABLE   from dual);

Thanks

Amar Alam

Monday, 19 October 2020

Oracle Cloud + Query to get AR Receipts Recommendations Details

6 comments

 SELECT 

    acra.receipt_number            receipt_number

   ,rcta.trx_number                recommendation

   ,acr.match_score_value          reference_score

   ,DECODE(acr.match_reason_code ,'AR_AA_BELOW_TRX_TSLD','Below transaction threshold','AR_AM_INV_THRESHOLD','Above transaction threshold') reason

   ,apsa.amount_due_remaining      balance

   ,DECODE(tta.type, 'INV', 'Invoice', 'CM', 'Credit Memo') document_type

   ,hp.party_name                  customer

   ,acr.recommendation_status      accepted

   ,acr.amount_applied

   ,SUBSTR(apsa.trx_number,'-0',7)||' '||acr.amount_applied Reference_number

FROM

    ar_cash_receipts_all            acra

   ,ar_receipt_methods              arm

   ,ar_cash_remit_refs_all          acrfa

   ,ar_cash_recos_all               acr

   ,ar_cash_reco_lines_all          acrla

   ,ra_customer_trx_all             rcta

   ,ar_payment_schedules_all        apsa

   ,ra_cust_trx_types_all           tta

   ,hz_cust_accounts                hca

   ,hz_parties                      hp

   ,hz_party_sites                  hps

   ,hz_cust_site_uses_all           hcsu

   ,hz_cust_acct_sites_all          hcsa

WHERE 1 = 1

    AND acra.receipt_number          = '111300952062031'

AND acra.receipt_method_id       = arm.receipt_method_id   

AND acra.cash_receipt_id         = acrfa.cash_receipt_id

AND acrfa.remit_reference_id     = acr.remit_reference_id

AND acr.recommendation_id        = acrla.recommendation_id

AND acr.resolved_matching_number = rcta.trx_number

AND rcta.customer_trx_id         = apsa.customer_trx_id

AND rcta.cust_trx_type_seq_id    = tta.cust_trx_type_seq_id

AND rcta.bill_to_customer_id     = hca.cust_account_id

AND acr.customer_id              = hca.cust_account_id

AND hca.party_id                 = hp.party_id

AND hp.party_id                  = hps.party_id

AND acr.customer_site_use_id     = hcsu.site_use_id

AND hcsu.cust_acct_site_id       = hcsa.cust_acct_site_id

AND hcsa.cust_account_id         = hca.cust_account_id

AND hcsa.party_site_id           = hps.party_site_id


Thanks

Amar Alam