Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Does "0" exist for DATE?
The other solution would be to substitute a real date for unknown dates.
But this is asking for trouble. This is what happened when some
programmers used all 9's for the unknown date and on 9/9/99, there
could've been potential problems. Use NULL if you don't know the date.
HTH,
Brian
Kenneth C Stahl wrote:
>
> Casey Claiborne wrote:
> >
> > Hello,
> >
> > Is there a way to initialize DATE with a default? For example, an
> > INTEGER type can be set to 0, so can a FLOAT.
> >
> > For example, suppose I have a field for a Customer called
> > DateOfMarriage. If the customer is not married, this field does not
> > apply. What can I set it to in the database? If I use NULL, then
> > I will have to worry about ISNULL or ISNOTNULL situations.
> >
> > Any help on this issue would be *greatly* appreciated :)
> >
> > TIA
> >
> > Casey
>
> But that is what you are supposed to do. If it doesn't have a real value
> then it should be set to null. Part of learning sql programming is learning
> how to handle null values correctly. Trying to shoe-horn workarounds will
> generally get you in trouble down the road somewhere. The best bet is to
> learn how to use sql properly and conform to universally accepted
> conventions.
Received on Fri Jan 07 2000 - 07:57:15 CST
![]() |
![]() |