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

Reply via email to