| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: The BOOLEAN data type
"--CELKO--" <71062.1056_at_compuserve.com> wrote in message
news:c0d87ec0.0304081511.36fdbd40_at_posting.google.com...
> >> Let's say you have a table of product orders and you need to know
> which one's have been shipped and which one's haven't. That's a
> boolean value that can't be computed from other data. <<
>
> Wrong:
>
> CREATE TABLE Orders
> (order_nbr INTEGER NOT NULL PRIMARY KEY,
> ..
> ship_date DATE, -- null means not yet shipped
> ..);
>
> And please don't tell that you would not record the shipping date,
> shipping charges, shipping method, etc. in the database.
So, you are saying NULL may have a valid semantic meaning? Doesn't NULL (in this example) mean, "have not a clue, maybe it was shipped, maybe it wasn't, maybe it will be shipped one day..."? Shouldn't it work like this:
IF Shipping_Date <= Today, then it's been shipped
Else If Shipping_Date > Today, it has not yet been shipped, but apparently
will be on the given date
Else If Shipping_Date IS NULL, then we just don't know...
Received on Wed Apr 09 2003 - 08:38:48 CDT
![]() |
![]() |