best practice? null/None (correction)
Andy Todd
ajtodd at mpower.com.au
Fri Mar 30 21:23:42 EST 2001
Having used Oracle for far too many years I can confirm that "" and NULL
are not the same, sorry Robin.
The Oracle RDBMS implements the standard ANSI SQL function 'is'/'is not'
for testing for null.
eg. SELECT 'x'
FROM my_table
WHERE my_column IS NULL
is NOT the same as
SELECT 'x'
FROM my_table
WHERE my_column=''
and will not be guaranteed to return the same results as specified in
"Oracle SQL Language Reference Manual".
What you *may* have observed is that some implementations of SQL (for
intance SQL*Plus) allow lazy programming and will converted NULL
VARCHAR2 column values into the empty string after selecting them from
the database.
Andy Todd
-- "Today I'm a part time Oracle DBA and full time head scratcher"
Alex Martelli wrote:
>
> "Robin Thomas" <robin.thomas at starmedia.net> wrote in message
> news:mailman.985976988.3926.python-list at python.org...
> > At 11:58 AM 3/30/01 -0500, Robin Thomas wrote:
> > >HTTP query arguments are of one type: STRING. There is no concept of a
> > >"null" value; the closest thing you have is an "empty" string like "". In
> > >most database engines, there is a clear difference between NULL and "" in
> > >any textual or character data column.
> >
> > I'm sorry to be outright WRONG here, fluxent.
> >
> > Many databases consider "" to be NULL for textual columns. Oracle 7 and up
> > certainly does.
>
> Wok?! I _thought_ Oracle was an RDBMS -- fun to hear that it isn't
> (proper treatment of NULL as distinguished from any data value being
> one crucial requisite for being called an RDBMS). Guess I'll stick with
> SQL Server/MSDE then...
>
> Alex
More information about the Python-list
mailing list