Subject | Re: [firebird-support] NULL and equality |
---|---|
Author | Martijn Tonies |
Post date | 2004-05-31T08:10:59Z |
Hi,
As the .value or .state doesn't exists, the distinction
comes via equals (=) or a state check (is). There you
have it, it's because the .state/.value doesn't exist :-)
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> >> Now on the one hand, the SQL standard stresses that "state" andExcept that "is" is used for states :-) and "equals" for values.
> >> "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 5
> 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 ?Yes.
> 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 useBecause I'm used to "is" :-)
>
> FIELD = 5
> FIELD = NULL
>
> when you want to test whether:
>
> FIELD.value equals 5
> FIELD.state equals NULL
As the .value or .state doesn't exists, the distinction
comes via equals (=) or a state check (is). There you
have it, it's because the .state/.value doesn't exist :-)
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com