Manjeet writes:
> I created table using following syntax,
>
> create table user (Login_Id varchar(16) NOT NULL, Location varchar(16) NOT
> NULL, PRIMARY KEY (Login_ID));
>
> The above table should not take any null values.
> I tryed inserting some null values eg:
>
> INSERT INTO user (Login_Id,Location) values ("","");
>
> According to me this statement should give error and not work. But still it
> inserts null values in to the table.
> When the same insert statement is run again, it gives error 1062.
> Plz... suggest how to see that my table does not have any NULL value and
> should i acheive this.
> Or is this a bug.
>
> Thanks
> Manjeet
>
This worked as expected. MySQL inserted the empty string in both
columns.
You can not insert it again as there is a primary key on one column.
--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com
---------------------------------------------------------------------
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