Sir,
please tell me how to stop mysql from accepting empty string values.
it accepts empty string values even when i enclosed in single quotes.
pl inform me with the syntax.
rgds
palani
>From: "Dennis Salguero" <[EMAIL PROTECTED]>
>To: "Ramasamy Palaniappan" <[EMAIL PROTECTED]>,
><[EMAIL PROTECTED]>
>Subject: Re: help on mysql tables
>Date: Tue, 27 Mar 2001 07:08:29 -0500
>
>----- Original Message -----
>From: "Ramasamy Palaniappan" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, March 27, 2001 6:53 AM
>Subject: help on mysql tables
>
>
> > I have created the following table:
> >
> > create table test(name varchar(10) NOT NULL);
> > query is ok
>
>Yes, but notice that you put a constraint of NOT NULL on the field. This
>means that there has to be a value in this field, in every record.
>
> > I HAVE TRIED THE FOLLOWING QUERY :
> >
> > insert into test values("");
> >
> > MYSQL COMMAND IS ACCEPTING THE ABOVE QUERY WHICH VIOLATES NOT NULL
> > CONSTRAINTS.
>
>First problem is that you should specify a table field after the table name
>and you should specify a corresponding piece of data in the VALUES portion
>of your statement. Next, you need to make sure that the data you enter is
>NOT blank since the field has a NOT NULL constraint. Finally, you should
>encase your data in single quotation marks, not double quotation marks.
>Therefore, change your statement to:
>
>INSERT INTO test(name) VALUES('something');
>
>If your table has only one field, you can also use the statement below:
>
>INSERT INTO test VALUES('something');
>
>Good luck,
>
>Dennis
>**********************************************'
>Beridney Computer Services
>[EMAIL PROTECTED]
>P: 703-566-3196
>http://www.beridney.com
>
>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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