Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Date columns
Steve Bell <swayne.bell_at_sympatico.ca> writes:
> The NVL function doesn't work either - i.e. entering a null in the
> date field then selecting NVL(datefield, '0') - same error.
This is because oracle expects a particular columns to have the same type in all rows returned. '0' is not a date but all not nulls will be dates.
This however does work
select decode (x, NULL, 0, 1) from x1;
(where x is of type DATE).
Still I think NULL *is* the correct value to express "no date" or "date not set" or the like. Received on Wed Apr 11 2001 - 17:36:05 CDT
![]() |
![]() |