Re: Sacred EIAS



Handling NULL in RDBMS's also require a lot of attention, especially in the
disticnction between NULL and an empty string.
In Oracle, NULL values are not indexed for example (except in bitmap
indexes) and you have to take special care in specifying conditions if you
allow null's in your data or you may get unexpected results. (esp. in
defining joins).
Here's what Oracle says in it's sql reference on strings and nulls:

"Note: Oracle Database currently treats a character value with a
length of zero as null. However, this may not continue to be true in
future releases, and Oracle recommends that you do not treat empty
strings the same as nulls."

So in practice in Oracle empty strings are equal to NULL's. (The "however"
part is in there for ages)
If you query a database from an application, imho you can and always should
avoid to get NULL's.
A NULL has either a meaning which follows from the data model or your
application logic, or signals bad data or bad design.
In general it signals an unknown state about the data.
Which means that there can not be a general solution, but the designer of an
application can make a few choices: you can allways handle NULL's in your
sql statement by using NVL or DECODE functions or IS NULL conditions.

I didn't follow this discussion so there maybe other reasons to
differentiate between empty strings and NULL's in Tcl, but if the thread was
started by the wish to handle the occurrence of NULL's in an database API, I
think it shouldn't.
Handling NULL's should be left to the designer of the application who knows
why they can occur and the sql gives enough tools to handle them. Default
handling would ofcourse be returning an empty string.

Harm Olthof

"Bryan Oakley" <oakley@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:BEl7k.10875$uE5.8854@xxxxxxxxxxxxxxxxxxxxxxx
neuronstorm@xxxxxxxxx wrote:

Can you explain further why the distinction between NULL for a
particular value, and non-existence of the value is important?

Most databases make a distinction between a null value and an empty value.
I think the whole discussion started when people tried to design a
database API that returned the result of a query as a list. The question
becomes, how to distinctly represent the results of a query that can
return null values.

One can't use an empty string because that would be indistinguishable from
a database value that is the empty string, and sometimes that is an
important distinction to be made (think: "you haven't told me whether or
not you have medicinal allergies" versus "you've told me you have no
medicinal allergies"). So, someone suggested a special value. That won't
work in a general sense, obviously because of the case where a valid
database entry happens to have the same string representation of this
special value.

The problem of course is that in the Tcl world of EIAS, there is no string
representation that can be used to represent the absence of a value.


.



Relevant Pages

  • Re: Oracle NULL vs revisited
    ... If we had a '' in Oracle then its length would be 0, but we don't, ... invoice identifier. ... Nulls would have been nothing like equivalent ... to using an empty string and would have added needless complexity. ...
    (comp.databases.oracle.server)
  • Re: Empty String Question
    ... I'm surprised that Oracle changes an empty string to NULL. ... > We have recently converted an Oracle Database to SQL Server 2000. ...
    (microsoft.public.sqlserver.server)
  • Re: Weird Query
    ... I'd withdrawn $100 from the account and my receipt said I had $0.00 remaining balance. ... engines that support it. ... As in Oracle you can not (without additional ... attributes) distinguish between NULL and empty string, ...
    (comp.databases.oracle.misc)
  • RE: oracleparameter returns empty resultset
    ... Move to a stored procedure and test input. ... (have not worked in Oracle in months), so alter to correct syntax: ... > when I pass an empty string in one of the paramters the result set is empty. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Sacred EIAS
    ... Most databases make a distinction between a null value and an empty ... a database API that returned the result of a query as a list. ... One can't use an empty string because that would be indistinguishable ... An empty string is of course a legitimate and useful value - and Tcl ...
    (comp.lang.tcl)