Yup, empty strings ('') are not the same thing as NULL in SQL.  I
believe MySQL supports this difference.

If someone submitted an empty form, and that form touched fields in your
database (even though nothing was inserted), then those columns contain
nothing (i.e., empty strings) rather than NULLs.  If your form/insert
did not touch a particular field at all, that field would still be null.

In MSSQL, true null values in a table are shown as <NULL>, but empty
strings just show as blanks.  If you query using their Query Analyzer
tool, it shows NULL vs blank - it even exports "NULL" if you save the
query results to a file.  You can also change a value back to NULL with
a [CTL]-[0] (using the Enterprise Manager GUI).  I've not used MySQL
enough to say how it shows the difference (if at all), but it may be
similar, depending on the tools you're using.  

You're probably not used to seeing these nuances because Witango handles
most of them for you.  I think searching for an empty string (column =
'') will always find nulls as well as empty strings...except maybe in
Access - I seem to have a lot of problems with nulls/empty strings
whenever I use Access, partly because you can't see the difference as
easily (Access just shows blanks for both).

Hope that helps!

jamileh


> -----Original Message-----
> From: Roland Dumas [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, September 04, 2003 12:52 PM
> To: WiTango List
> Subject: Witango-Talk: empty argument
> 
> 
> I have a search action that looks for
> <@ARG 1> = column1 AND
> <@ARG 1> = column2 AND
> column1 is not NULL AND
> column2 is not NULL
> 
> so if someone does an empty form, it should return nothing. It never 
> does. Always gets a foundset. Same records, in fact. It finds records 
> that have null content in column1 and column2  (mysql)
> 
> (I can trap for empty arguments, but this seems odd)
> 
> ______________________________________________________________
> __________
> TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
> 
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf

Reply via email to