NVL2 Function
ShapsFeb 29 2012 — edited Feb 29 2012Hi Guys,
I have a query below which gives accurate result when output is not NULL but a NULL output when check attribute is NULL. I am using Oracle 10G
select nvl2(uj.JOB,'S','F') from user_jobs uj
where uj.what like '%MONTHLY_SUMMARY%'
and to_char(uj.NEXT_DATE,'yyyymm') = to_char(add_months(sysdate,1),'yyyymm') returns 'S'
select nvl2(uj.JOB,'S','F') from user_jobs uj
where uj.what like '%MV_VAA_WO_MONTHLY_SUMMARY_ACC%'
and to_char(uj.NEXT_DATE,'yyyymm') = to_char(add_months(sysdate,2),'yyyymm') returns 'NULL'
Cheers,
Shaz