Hello,

CREATE TABLE tblTEST(field1 VARCHAR(20) NOT NULL, field2 VARCHAR(20) NOT
NULL);

INSERT INTO tblTEST (field1) VALUES (NULL);
INSERT INTO tblTEST (field2) VALUES (NULL);
INSERT INTO tblTEST (field1,field2) VALUES (NULL,'HELLO');

not accepting NULL  values; but

INSERT INTO tblTEST (field1) VALUES ('HELLO');

This statement inserting empty value in 'field2'.

field1         field2
HELLO

so how can we make INSERT statement to fail if value of NOT NULL field is
not supplied.

thanks

regards,
sreedhar


----- Original Message -----
From: "Paul DuBois" <[EMAIL PROTECTED]>
To: "sreedhar" <[EMAIL PROTECTED]>; "mysql" <[EMAIL PROTECTED]>
Sent: Wednesday, December 12, 2001 11:25 PM
Subject: Re: NOT NULL field accepting NULL


> At 7:12 PM +0530 12/12/01, sreedhar wrote:
> >Hi All,
> >
> >In MySQL, Even i declared a field as NOT NULL it is accepting nulls .What
> >might be the
> >problem. please let me know.
> >
> >regards,
> >sreedhar
>
> That's not enough information.
>
> Let's see the CREATE TABLE statement, a sample INSERT statement, and
> the resulting record.
>
>
> ---------------------------------------------------------------------
> 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

Reply via email to