Re: NOT NULL = Not Working?

2007-05-09 Thread Scott Baker
I knew it was an option somewhere... Perfect! Thanks JamesDR wrote: > JamesDR wrote: >> Scott Baker wrote: >>> If I create the following table, and then try and insert the following >>> data both inserts work. It looks like the second one works (it shouldn't >>> because Last is NULL) because it a

Re: NOT NULL = Not Working?

2007-05-09 Thread JamesDR
JamesDR wrote: > Scott Baker wrote: >> If I create the following table, and then try and insert the following >> data both inserts work. It looks like the second one works (it shouldn't >> because Last is NULL) because it assumes Last = ''. Is there a way I can >> make it NOT assume that? If Last i

Re: NOT NULL = Not Working?

2007-05-09 Thread Ricardo Conrado Serafim
Scott Baker escreveu: If I create the following table, and then try and insert the following data both inserts work. It looks like the second one works (it shouldn't because Last is NULL) because it assumes Last = ''. Is there a way I can make it NOT assume that? If Last is not specified it shoul

Re: NOT NULL = Not Working?

2007-05-09 Thread JamesDR
Scott Baker wrote: > If I create the following table, and then try and insert the following > data both inserts work. It looks like the second one works (it shouldn't > because Last is NULL) because it assumes Last = ''. Is there a way I can > make it NOT assume that? If Last is not specified it sh

Re: NOT NULL and default: using mysqldump to upgrade from 4.0 to 5.0

2005-12-24 Thread Gleb Paharenko
Hello. The error should disappear if you perform the dump using --quote-names option. Alex Davies <[EMAIL PROTECTED]> wrote: >Hi, > >I have two servers and am trying to move the database from one to the other. > >The data is currently residing in a MySQL 4.0 database. The new server i

Re: not null values

2005-08-29 Thread Michael Stassen
joshua pereira wrote: i want to make it so that i will have to fill in all the attributes in .so i put not null for all the attributes. Is this correct ?? when for example do not fill in user_name , all the other values is accepted and stored in the databaseplease advise create table user_d

RE: not null values

2005-08-29 Thread Sujay Koduri
Use the keyword 'default' to make the attributes default to the values you want. Use some thing like this user_name varchar(50) default 'default_value' not null sujay -Original Message- From: joshua pereira [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 5:24 PM To: mysql@list

Re: NOT NULL

2004-08-08 Thread Rhino
- Original Message - From: "Justin French" <[EMAIL PROTECTED]> To: "MySQL" <[EMAIL PROTECTED]> Sent: Sunday, August 08, 2004 11:13 PM Subject: NOT NULL > Can someone give me a quick/clear explanation about why you would > create a table with columns of NULL / NOT NULL? > > I clicked aro

Re: NOT NULL

2004-08-08 Thread Whil Hentzen
On Sunday 08 August 2004 22:13, Justin French wrote: > Can someone give me a quick/clear explanation about why you would > create a table with columns of NULL / NOT NULL? > > I clicked around the MySQL manual last night I *think* I know what's > what, but it'd be great to read one clear paragraph t

Re: NOT NULL column behaves strangely

2004-04-14 Thread Michael Stassen
Ruslan U. Zakirov wrote: Keith C. Ivey wrote: On 14 Apr 2004 at 17:27, B. Fongo wrote: I expected a warning because of the Token column shouldn't be NULL! It's not NULL. It's the empty string, which is the default value, since you didn't give it a specific default value. See the "CREATE TAB

Re: NOT NULL column behaves strangely

2004-04-14 Thread Ruslan U. Zakirov
Keith C. Ivey wrote: On 14 Apr 2004 at 17:27, B. Fongo wrote: I expected a warning because of the Token column shouldn't be NULL! It's not NULL. It's the empty string, which is the default value, since you didn't give it a specific default value. See the "CREATE TABLE" documentation:

Re: NOT NULL column behaves strangely

2004-04-14 Thread Martijn Tonies
Hi, > Why does MySQL accept this insert statement with a warning? > > Insert into Sessions (id) values (20de8376640263673ea03938); > > Query OK, 1 row affected. > > I expected a warning because of the Token column shouldn't be NULL! > > I have a table with three columns: > > Id # int not null > T

Re: NOT NULL column behaves strangely

2004-04-14 Thread Keith C. Ivey
On 14 Apr 2004 at 17:27, B. Fongo wrote: > I expected a warning because of the Token column shouldn't be NULL! It's not NULL. It's the empty string, which is the default value, since you didn't give it a specific default value. See the "CREATE TABLE" documentation: If no DEFAULT value i

Re: NOT NULL fields in INNODB Tables

2004-01-09 Thread Roger Baklund
* Donal Murtagh > My DB consists of INNODB tables, such as... > > > CREATE TABLE user > ( > name VARCHAR(255) NOT NULL > > ) TYPE = INNODB; > > > The NOT NULL qualifier doesn't have the effect I expected. Although I > can't do this... > > INSERT user VALUES (null); > > > I can do this: > > INSERT u

Re: "not null" and default values confusion

2003-11-01 Thread Martijn Tonies
Hi, > This question comes up a lot. You should take a look at > . The first line > is, "To be able to support easy handling of non-transactional tables, > all fields in MySQL have default values." Mysql automatically converts > missing or il

RE: "not null" and default values confusion

2003-11-01 Thread Jan Magnusson
o:[EMAIL PROTECTED] > Sent: Saturday, November 01, 2003 05:13 > To: Jan Magnusson > Cc: Mysql General mailing list > Subject: Re: "not null" and default values confusion > > > Jan, > > This question comes up a lot. You should take a look at > <http://www.m

Re: "not null" and default values confusion

2003-10-31 Thread Michael Stassen
Jan, This question comes up a lot. You should take a look at . The first line is, "To be able to support easy handling of non-transactional tables, all fields in MySQL have default values." Mysql automatically converts missing or illegal

Re: NOT NULL ?

2003-06-17 Thread Becoming Digital
g the > data before inserting it into your table. Oh, wait... we're already in agreement. :p Edward Dudlik Becoming Digital www.becomingdigital.com - Original Message - From: "Keith C. Ivey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, 17 June,

Re: NOT NULL ?

2003-06-17 Thread Keith C. Ivey
On 16 Jun 2003 at 19:29, Becoming Digital wrote: > Think of the many cases in which you would not want a field left > blank: a customer's last name or zip code, a product's name or id > number, a payment amount. Were any of those fields allowed to be > NULL, the system of which they are a part co

Re: NOT NULL ?

2003-06-16 Thread Becoming Digital
NOT NULL ensures that a field cannot be left blank. This is necessary for primary keys because a null value would lead to a collapse in relationships. For other fields, NOT NULL is used to speed SELECT queries and again to make sure the field is filled. Think of the many cases in which you would

Re: Not Null isn't working or am I wrong

2003-04-05 Thread Bruce Feist
Paul DuBois wrote: At 16:23 -0500 4/4/03, <[EMAIL PROTECTED]> wrote: Now when i put data into the table i can't have all blanks which is right. When i put data into the field that allows nulls the not null one gets '' as its data and goes on. I though NULL and '' were the same thing. Am i n

Re: Not Null isn't working or am I wrong

2003-04-05 Thread Paul DuBois
At 16:23 -0500 4/4/03, <[EMAIL PROTECTED]> wrote: Hi everyone, When creating a table I have a autonumber primary key, a varchar(30) field that is not null and another field that not null is not selected. Here is the table creation command i used. CREATE TABLE `TableName` (`ID` INT (3) UNSI

Re: NOT NULL question

2003-01-23 Thread Benjamin Pflugmann
Hi. On Wed 2003-01-22 at 23:07:24 -0800, [EMAIL PROTECTED] wrote: > I'm really just currious as to WHAT you would want to see as opposed > to NULL? Well, you asking the wrong guy, because I did not need that feature, but I'll try to explain anyhow. They want to see an error instead. It is the

re: NOT NULL Fields

2003-01-23 Thread Egor Egorov
On Wednesday 22 January 2003 19:24, Valdir Stiebe Junior wrote: > Creating a table with a not null field, and then trying to insert it > doesn't raise an error 'Column XXX cannot be null' > Well, this was the steps (sql to bypass filter) i did: > > 1. create table TEST ( id_test integer, name varc

Re: NOT NULL question

2003-01-23 Thread Opus
I'm really just currious as to WHAT you would want to see as opposed to NULL? How could you have a field that has no value? What would it mean? NULL is the answer to this. It is recording the absence of something. So, I would say that this is an expected behaviour of any database engine.

re: RE: NOT NULL question

2003-01-16 Thread Egor Egorov
On Wednesday 15 January 2003 22:36, Gabe Geisendorfer wrote: > Thanks, I check it out.. Any idea if this 'deficiency' is scheduled to > change? Yes. http://www.mysql.com/doc/en/TODO_future.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This

RE: NOT NULL question

2003-01-15 Thread Gabe Geisendorfer
Thanks, I check it out.. Any idea if this 'deficiency' is scheduled to change? Thanks, Gabe -Original Message- From: Benjamin Pflugmann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 15, 2003 9:49 AM To: Gabe Geisendorfer Cc: [EMAIL PROTECTED] Subject: Re: NOT NUL

Re: NOT NULL question

2003-01-15 Thread Benjamin Pflugmann
Hello. On Tue 2003-01-14 at 09:32:02 -0800, [EMAIL PROTECTED] wrote: > I'm aware that NULL and "" are not the same thing.. I would like to > prevent the column from accepting values automatically ( with out the > presence of a DEFAULT). [...] The problem is: You have a DEFAULT, you just don't kno

Re: Not Null

2002-09-27 Thread Clayburn W. Juniel, III
On Thursday, September 26, 2002, at 06:30 AM, Egor Egorov wrote: > Clayburn, > Thursday, September 26, 2002, 3:58:13 AM, you wrote: > > CWJI> I create a table with a VarChar field set to not null. When I > do an > CWJI> insert into this table with no value for this field it goes > thr

re: Not Null

2002-09-26 Thread Egor Egorov
Clayburn, Thursday, September 26, 2002, 3:58:13 AM, you wrote: CWJI> I create a table with a VarChar field set to not null. When I do an CWJI> insert into this table with no value for this field it goes through CWJI> without a problem. I realize MySQL inserts a empty string into the CWJI> fie

Re: Not null not working??

2002-04-04 Thread Colin Faber
Well also, 0x00 != 0 and to test for NULL in mysql you need to use special functions IS NULL, IS NOT NULL etc. Rodney Broom wrote: > > From: Andrew Hazen <[EMAIL PROTECTED]> > > > If it was blank, the sql statement would fail... > > Nope, you're passing an empty string with '$login'. NULL is

RE: Not null not working??

2002-04-04 Thread Gurhan Ozen
Hi Andrew, If you insert NULL value into a column that is defined as NOT NULL , the server puts in empty string ('') for the value... Try to use PHP to enforce $login to have a string value. Or you can compile a source distribution with -DDONT_USE_DEFAULT_FIELDS option to overcome this. See : htt

Re: Not null not working??

2002-04-04 Thread Rodney Broom
From: Andrew Hazen <[EMAIL PROTECTED]> > If it was blank, the sql statement would fail... Nope, you're passing an empty string with '$login'. NULL is not empty, it's less that that. It's nothing. What you want is: emplogin=$login Rather than: emplogin='$login' > ...is SOMETIMES blank

RE: Not null not working??

2002-04-04 Thread Rick Emery
It is not inserting NULL. when $login is NULL or blank, then a a record, with emplogin equal to a string of zero characters is inserted, which is valid. A string with zero characters is NOT a NULL value. So, it is accepted. -Original Message- From: Andrew Hazen [mailto:[EMAIL PROTECTED

Re: NOT NULL field accepting NULL

2001-12-12 Thread Paul DuBois
t; thanks > > regards, > sreedhar > > > - Original Message - > From: "Paul DuBois" <[EMAIL PROTECTED]> > To: "sreedhar" <[EMAIL PROTECTED]>; "mysql" <[EMAIL PROTECTED]> > Sent: Wednesday, December 12, 2001 11:25

Re: NOT NULL field accepting NULL

2001-12-12 Thread sreedhar
" <[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, > >

Re: NOT NULL field accepting NULL

2001-12-12 Thread sherzodR
No, it's not accepting NULL if it was declared as NOT NULL. It's just accepting an empty sting ( "" ). CREATE TABLE test (t VARCHAR(10) NOT NULL); INSERT INTO test SET t = NULL; INSERT INTO test SET t = ''; First insert will tell you what you're waiting for. And the second one will do what you

Re: NOT NULL field accepting NULL

2001-12-12 Thread Paul DuBois
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 t

Re: not null

2001-07-27 Thread Stefan Hinz
Dear Christiane, as it really seems to be your first database, I will help you ;-) > create table table_name ( > Column_Name not null > ); CREATE TABLE table_name (Column_Name CHAR(50) NOT NULL) is correct. Replace the field type and length (CHAR(50)) to suit your needs. Regards, -- Ste

Re: not null

2001-07-27 Thread Grigory Bakunov
Date |Fri, 27 Jul 2001 00:47:50 EDT >From |[EMAIL PROTECTED] Hello! C> I am having trouble setting a column attribute to not null. Below is the C> statement I am using: C> create table table_name ( C> Column_Name not null C> ); C> If this is not the correct way to do it, can someone please h

Re: not null

2001-07-27 Thread Werner Stuerenburg
Example: CREATE TABLE rassen ( id smallint(5) unsigned NOT NULL auto_increment, bezeichnung varchar(50) NOT NULL, kurz varchar(25) NOT NULL, total smallint(5) unsigned DEFAULT '0' NOT NULL, totalDeck tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (id), KEY id (id, bezeichnung),

Re: not null

2001-07-27 Thread Gerald Clark
[EMAIL PROTECTED] wrote: > I am having trouble setting a column attribute to not null. Below is the > statement I am using: > > create table table_name ( > Column_Name not null > ); > > If this is not the correct way to do it, can someone please help me...this is > my first mysql datab

RE: not null

2001-07-27 Thread Bruce Stewart
You must specify a datatype: create table table_name ( Column_Name integer not null ); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Fri, 27 July 2001 06:48 To: [EMAIL PROTECTED] Subject: not null I am having trouble setting a column attribute to not n

Re: not null

2001-07-27 Thread Nessi
Hm you need to define what kind of column you want... like integer, text, varchar, enum etc etc something like: create table tablename (ID int not null auto_increment, something varchar(255) not null, ...) I would strongly recommend to read the manual! You find it at www.mysql.com There are man

Re: not null

2001-07-27 Thread Sebastiaan Smit
> create table table_name ( > Column_Name not null > ); > If this is not the correct way to do it, can someone please help me...this is > my first mysql database. You have to give the type of the column after the name first (int, varchar etc..) -- Sebastiaan Smit