At 5:42 PM -0500 9/7/99, Peter J. Schoenster wrote:
>When I try to do this:
>title char(50) NOT NULL,
>and mysql ends up putting this in:
>title char(50) DEFAULT '' NOT NULL,
>and so if someone doesn't enter a title, it
>still passes when I want it to fail.
>Why does mysql put the DEFAULT '' in there?
>If a user puts characters in an int field it is
>automatically coverted to 0. I would prefer it
>to just fail.
Declaring a character column NOT NULL has nothing to do with whether
or the column can contain an empty string, because an empty string is
different than NULL.
So ... sorry, you're out of luck. This constraint is something you'll
have to check in your own application logic.
Paul DuBois, paul@stripped
Northern League Chronicles: http://www.snake.net/nl/