Subject | Re: [firebird-support] NULL and equality |
---|---|
Author | Paul Vinkenoog |
Post date | 2004-05-30T15:57:09Z |
Hi Martijn,
FIELD is NULL
sound just as fine to me for a test.
The point is, what do you mean when you say: FIELD becomes X ?
Because the field as such doesn't become 5, or NULL, or whatever.
In the first example, you mean that the field VALUE becomes 5.
In the second, that the field STATE becomes NULL.
So again, if you're quite happy with using
FIELD = 5
FIELD = NULL
when they really mean:
FIELD.value becomes 5
FIELD.state becomes NULL
why not use
FIELD = 5
FIELD = NULL
when you want to test whether:
FIELD.value equals 5
FIELD.state equals NULL
Greetings,
Paul Vinkenoog
>> Martijn:The *nerve* ! :-)
>
> (me, disagreeing ;-)
>> Now on the one hand, the SQL standard stresses that "state" andFIELD is 5
>> "value" are such different concepts that we really, really mustn't
>> use the same equality operator for them (hence '=' for value
>> comparison and 'is' for state comparison)...
>>
>> ...but when we're talking assignment, all of a sudden it's no
>> problem to use the same operator to assign a value and a
>> state. That's inconsistent.
> Nope, it isn't...
>
> FIELD becomes 5
> FIELD becomes NULL
>
> Sounds fine to me for an assignment.
FIELD is NULL
sound just as fine to me for a test.
The point is, what do you mean when you say: FIELD becomes X ?
Because the field as such doesn't become 5, or NULL, or whatever.
In the first example, you mean that the field VALUE becomes 5.
In the second, that the field STATE becomes NULL.
So again, if you're quite happy with using
FIELD = 5
FIELD = NULL
when they really mean:
FIELD.value becomes 5
FIELD.state becomes NULL
why not use
FIELD = 5
FIELD = NULL
when you want to test whether:
FIELD.value equals 5
FIELD.state equals NULL
Greetings,
Paul Vinkenoog