Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NVL2 Function

ShapsFeb 29 2012 — edited Feb 29 2012
Hi 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
This post has been answered by 32685 on Feb 29 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2012
Added on Feb 29 2012
10 comments
210 views