Ben wrote:
I'm sorry maybe I missed something, but if you don't need NULLs and
feel they just add extra work, why don't you just declare all your
columns to be not null and have them default to zero or an empty string?
....which is what mySQL does by default :-)
The statement
CREATE TABLE foo (bar INTEGER NOT NULL, rab VARHCAR(123) NOT NULL, oof
DATETIME NOT NULL,);
will be rewritten automatically by mySQL to
CREATE TABLE foo (bar INTEGER NOT NULL DEFAULT 0, rab VARHCAR(123) NOT
NULL DEFAULT '', oof DATETIME NOT NULL DEFAULT '0000-00-00 00:00');
Maybe if you really want to enforce a NOT NULL constraint in mySQL, you
have to declare a column as NOT NULL DEFAULT NULL, explicitly as was
suggested somewhere else in this thread. Fascinating how they probably
thought that was a good idea.
--
Tommy