Subject Re: seems bug : Field accepts NULL Values (empty string) even if it is defined w
Author johnsparrowuk
I think the designers of the SQL Spec picked a bad name in 'NULL'.
Just looked it up in the dictionary:

"Amounting to nothing : NIL
3 : having no value : INSIGNIFICANT
4 a : having no elements <null set> b : having zero as a limit <null
sequence> c of a matrix : having all elements equal to zero
5 a : indicating usually by a zero reading on a scale when a given
quantity (as current or voltage) is zero or when two quantities are
equal -- used of an instrument b : being or relating to a method of
measurement in which an unknown quantity (as of electric current) is
compared with a known quantity of the same kind and found equal by a
null detector
6 : of, being, or relating to zero
7 : ZERO 1c "

This confuses loads of SQL novices I know - especially when they're
programmers too, ('null pointers' etc, and in C# difference
between 'null' and 'DBNull.Value'!). Personally I always prefer to
say "if (x is DBNull)", more like sql syntax.

SQL should have chosen UNKNOWN as the name of the state, in my
opinion.

However, I agree that Firebird is totally correct in it's handling of
null strings!

John

--- In firebird-support@yahoogroups.com, "David Johnson"
<d_johnson@c...> wrote:
> When I first started programming for DBMS I thought so too. After
ten years in the paradigm, I use the distinction all the time.
>
> Null means "I haven't touched it and don't know the value", while
empty string means "I have deliberately said that it has an empty
value".
>
> The alternative is to add a flag to every field that would
otherwise be nullable that tells you whether the field is truly empty
or simply unknown. Then you have to maintain the separate flags, and
you are making the null versus deliberately empty distinction
manually.
>
> ----- Original Message -----
> From: Jonathan Neve
> To: firebird-support@yahoogroups.com
> Sent: Tuesday, March 16, 2004 3:08 AM
> Subject: Re: [firebird-support] Re: seems bug : Field accepts
NULL Values (empty string) even if it is defined w
>
>
> Alexander V.Nevsky wrote:
>
> >--- In firebird-support@yahoogroups.com, Jonathan Neve
<jonathan@m...>
> >wrote:
> >
> >
> >>Martijn Tonies wrote:
> >>
> >>
> >>
> >>>You're answering your own question: '' (empty string) is NOT
NULL.
> >>>NULL is NULL (empty). An empty string is a value. NULL is a
state,
> >>>so is "NOT NULL".
> >>>
> >>>
> >>>
> >>IMHO, this unique feature could nearly be considered a bug...
> >>
> >>
> >
> > In SQL standard? ;)
> >
> >
> Absolutely! A bug in that it defines a useless distinction that
would
> forever be a nuisance for every database developer! :-)
>
> Jonathan Neve.
>
>
> [Non-text portions of this message have been removed]
>
>
>
> --------------------------------------------------------------------
----------
> Yahoo! Groups Links
>
> a.. To visit your group on the web, go to:
> http://groups.yahoo.com/group/firebird-support/
>
> b.. To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
>
>
>
> [Non-text portions of this message have been removed]