Re: Demo: Modelling Cost of Travel Paths Between Towns
Date: Tue, 16 Nov 2004 09:20:46 -0500
Message-ID: <2vuglvF2p4mk3U1_at_uni-berlin.de>
"Neo" <neo55592_at_hotmail.com> wrote in message
news:4b45d3ad.0411151728.739fd3ea_at_posting.google.com...
> > UPDATE your_table
> > SET age = age + 1
> > WHERE name = 'john'
> > AND age IS NOT NULL
>
> You are not actually suggesting a solution with NULLs, are you?
>
> On page 571, 6th Ed of "An Intro to Db Systems", CJ Date states "NULLs
> and 3VL are a mistake and have no place in a clean formal system like
> the relational model".
You're the one who brought it up:
While TM/XDb2 does not have built-in operations such as the above,
> user can easily create code that will update the age of any thing
> whose name is john and has an age, including that of things whose
> class is unknow at design-time (ie a person)
Okay, I won't use a null, I'll use the idea of "unknown" instead. No big
deal:
UPDATE your_table
SET age = age + 1
WHERE name = 'john'
AND age > 0
or, depending on how you want to represent the idea of "unknown age" in the database, perhaps
UPDATE your_table
SET age = age + 1
WHERE name = 'john'
AND age = -1
Received on Tue Nov 16 2004 - 15:20:46 CET