21 messages in com.mysql.lists.mysqlRe: Does Null == ""?
FromSent OnAttachments
Randy Chrismon15 Sep 2003 09:46 
Mark Richards15 Sep 2003 10:02 
Bob Hall15 Sep 2003 18:02 
Bruce Feist15 Sep 2003 18:52 
Dan Nelson15 Sep 2003 19:24 
Jon Frisby15 Sep 2003 19:29 
Bruce Feist15 Sep 2003 19:33 
Bruce Feist15 Sep 2003 19:54 
Bob Hall15 Sep 2003 20:20 
Bob Hall15 Sep 2003 20:24 
Bob Hall15 Sep 2003 20:45 
Bob Hall15 Sep 2003 21:28 
Jon Frisby16 Sep 2003 11:47 
Bruce Feist16 Sep 2003 14:39 
Jon Frisby16 Sep 2003 14:55 
Bob Hall16 Sep 2003 17:31 
Bob Hall17 Sep 2003 12:57 
Bruce Feist17 Sep 2003 18:57 
Bob Hall17 Sep 2003 21:02 
Haydies18 Sep 2003 04:43 
Bob Hall18 Sep 2003 12:04 
Subject:Re: Does Null == ""?
From:Bob Hall (rjh@cox.net)
Date:09/15/2003 06:02:42 PM
List:com.mysql.lists.mysql

On Mon, Sep 15, 2003 at 12:46:50PM -0400, Randy Chrismon wrote:

an exort from a Lotus Notes database. At some point, the MySQL documentation says that a table with no nullable columns is better/faster than one with. The Lotus Notes database I'm migrating, however, has many fields with no values. I infer from the MySQL documentation that I'm better off doing:

create table my_table(a_field varchar(16) NOT NULL default "", ...)

and exporting my values from Notes as "" rather than using NULL.

No. The meaning of NULL is defined in the SQL specification; it means "not known" or "not applicable". If you have data that is missing because it is not known or not applicable, then use NULL.

A zero-length string has no defined meaning. I've done maintenance on databases that contained zero-length strings, and they were nightmares. I can't think of any reason why you would use a zero-length string in a database.