SQL Language (MOSC)

MOSC Banner

NVL different output based on bound type

edited May 23, 2019 5:01AM in SQL Language (MOSC) 2 commentsAnswered

Hello Folks,

I have a question related to NVL function output based on the type of the value bound.

It returns different output based on the the type of the bind variable when the value of the variable is NULL.

I have the following query.

SELECT NVL(:bind_var, TO_DATE('9998/12/31', 'yyyy/mm/dd')) from dual

  • Scenario 1: bind_var is STRING & it's value is NULL

          Output - 31-DEC-98

  • Scenario 2: bind_var is DATE & it's value is NULL

         Output - 12/31/9998

Note that NLS_DATE_FORMAT is DD-MON-RR.

Any thoughts why I'm having this different behavior?

Thank You

Navinth

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center