List:General Discussion« Previous MessageNext Message »
From:Wagner Bianchi Date:January 30 2010 4:40pm
Subject:Re: How to force Warning: #1048 Column cannot be null to Error
View as plain text  
mysql> SET sql_mode = TRADITIONAL;
Query OK, 0 rows affected (0.02 sec)

Then the insert query will fail and the row will not be added to the
table...see you.

Wagner Bianchi


2010/1/30 Claudio Nanni <claudio.nanni@stripped>

> Take a look at SQL_MODE ;)
>
> Claudio
>
> On Jan 30, 2010 5:05 PM, "Miao Jiang" <jiangfriend@stripped> wrote:
>
> When I try insert NULL to VARCHAR NOT NULL column,  It will shows a warning
> and convert NULL to '' then insert 。
> I want to MySQL raise an exception when I try do that.
> How to do that?
>
> Thank you.
> Miao
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
>

Thread
How to force Warning: #1048 Column cannot be null to ErrorMiao Jiang30 Jan
  • Re: How to force Warning: #1048 Column cannot be null to ErrorClaudio Nanni30 Jan
    • Re: How to force Warning: #1048 Column cannot be null to ErrorWagner Bianchi30 Jan