about nvl2 function

Giganews Newsgroups
Subject: about nvl2 function
Posted by:  riverdance (esthershen…@yahoo.com)
Date: Tue, 8 Jun 2010

HI,

sorry , I'm new to oracle world..

who could help explain following.. I expected following SQL would
error out.. but I got following result.

I don't understand, how date format string '1/1/2010' could convert
to number .000497512, and how date format string 1-1-2010 could
convert to number -2010?

SQL> select nvl2(birth_dt,0,1/1/2010) from eshen.test;

NVL2(BIRTH_DT,0,1/1/2010)
-------------------------
              .000497512
              .000497512

SQL> select nvl2(birth_dt,0,1-1-2010) from eshen.test;

NVL2(BIRTH_DT,0,1-1-2010)
-------------------------
                    -2010
                    -2010

Replies