I'm aware that NULL and "" are not the same thing.. I would like to prevent the column from accepting values automatically ( with out the presence of a DEFAULT).
-----Original Message----- From: Csongor Fagyal [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 14, 2003 8:21 AM To: [EMAIL PROTECTED] Subject: Re: InnoDB table, NOT NULL question > > >>Hello, I'm in the process of moving from Postgres to MySQL and I have >>a question. >> +How do you prevent a field from being left empty? >> >>I have an InnoDB table that looks like the following. >> >>CREATE TABLE `stuff` ( >> `stuff_id` int(11) NOT NULL auto_increment, >> `somevalue1` varchar(35) NOT NULL, >> `somevalue2` varchar(35) NOT NULL, >> PRIMARY KEY (`stuff_id`) >>) TYPE=InnoDB COMMENT='stuff table'; >> >>I run the following insert statement. >> >>INSERT INTO stuff ( somevalue2 ) VALUES ('blah') >> >>Now the field "somevalue1" is empty. Doesn't this violate the NOT NULL >>constraint on the field? >> Well, by empty you probably mean "", which is not null, is it? - Csongor --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php