Hi Neil,
On 10/30/2013 9:55 AM, Neil Tompkins wrote:
Shawn
What I need is that if I pass say 10 parameters/variables to a query, I
only want to update the column/field if the value passed is NOT NULL.
On Wed, Oct 30, 2013 at 3:41 AM, Shawn Green wrote:
Hi,
On 10/29/2013 9:52 PM, h
Shawn
What I need is that if I pass say 10 parameters/variables to a query, I
only want to update the column/field if the value passed is NOT NULL.
On Wed, Oct 30, 2013 at 3:41 AM, Shawn Green wrote:
> Hi,
>
> On 10/29/2013 9:52 PM, h...@tbbs.net wrote:
>
>> 2013/10/29
ut if MyVariable is NULL, FieldName1 reflects the attempt to change, not
change.
The way I understood the second explanation was like this.
He wants to update a row of data. The FieldName1 field is always updated
to the current date and time. If any of the new values (passed in via
variables
2013/10/29 11:35 -0400, Shawn Green
My favorite technique is the COALESCE function for this on a column-by-column
basis
SET FieldName1 = Now(), FieldName2 = COALESCE(:MyVariable, FieldName2)
but if MyVariable is NULL, FieldName1 reflects the attempt to change, not
change.
-
>>>> 2013/10/28 21:23 +, Neil Tompkins >>>>
Basically the snippet of the UPDATE statement I provided shows updating only 1
field.
However in my live working example, I have about 20 possible fields that
"might" need to be updated if the variable
that "might" need to be updated if the variable
passed for each field is NOT NULL.
Therefore, I felt this needs to be done at database level in the stored
procedure. How can I accomplish this.
Thanks
Neil
On Mon, Oct 28, 2013 at 6:17 PM, Shawn Green mailto:shawn.l.gr...@oracle.com>&
nippet of the UPDATE statement I provided shows updating only 1 field.
> However in my live working example, I have about 20 possible fields that
> "might" need to be updated if the variable passed for each field is NOT
> NULL.
>
> Therefore, I felt this needs to be done at databa
passed for each field is NOT
NULL.
Therefore, I felt this needs to be done at database level in the stored
procedure. How can I accomplish this.
Thanks
Neil
On Mon, Oct 28, 2013 at 6:17 PM, Shawn Green wrote:
> Hello Neil,
>
> On 10/28/2013 2:06 PM, Neil Tompkins wrote:
>
>> Hi
&
Try:
update my_table
set fieldname1 = Now(), Fieldname2 = :myVariable
where Fieldname3 is not null
On 10/28/13 11:06 AM, Neil Tompkins wrote:
Hi
If I have a update statement like
UPDATE MY_TABLE
SET FieldName1 = Now(), FieldName2 = :MyVariable
WHERE FieldName3 = 'Y'
How can I o
Hello Neil,
On 10/28/2013 2:06 PM, Neil Tompkins wrote:
Hi
If I have a update statement like
UPDATE MY_TABLE
SET FieldName1 = Now(), FieldName2 = :MyVariable
WHERE FieldName3 = 'Y'
How can I only update the FieldName2 field if the value of MyVariable is
NOT NULL ?
Thanks
Neil
Hi
If I have a update statement like
UPDATE MY_TABLE
SET FieldName1 = Now(), FieldName2 = :MyVariable
WHERE FieldName3 = 'Y'
How can I only update the FieldName2 field if the value of MyVariable is
NOT NULL ?
Thanks
Neil
Baron Schwartz wrote:
Hi Ed,
On Thu, Apr 3, 2008 at 3:32 PM, Ed W <[EMAIL PROTECTED]> wrote:
Hi
Up until version 5.0.44 (on linux) it appeared that you could do stuff like
deliberately insert a NULL into a NOT NULL varchar field and it would be
silently converted to an empty
Hi Ed,
On Thu, Apr 3, 2008 at 3:32 PM, Ed W <[EMAIL PROTECTED]> wrote:
> Hi
>
> Up until version 5.0.44 (on linux) it appeared that you could do stuff like
> deliberately insert a NULL into a NOT NULL varchar field and it would be
> silently converted to an empty string. Si
Hi
Up until version 5.0.44 (on linux) it appeared that you could do stuff
like deliberately insert a NULL into a NOT NULL varchar field and it
would be silently converted to an empty string. Similarly if you didn't
specify a value it appeared to use what is describe in the docs a
>>>
>>> DROP TABLE IF EXISTS foo;
>>>
>>> CREATE TABLE foo (
>>>ID INTEGER PRIMARY KEY AUTO_INCREMENT,
>>>First VarChar(30),
>>>Last VarChar(30) NOT NULL,
>>>Zip INTEGER
>>> );
>>>
>&g
>> make it NOT assume that? If Last is not specified it should reject that
>> command. Is that possible?
>>
>> ---
>>
>> DROP TABLE IF EXISTS foo;
>>
>> CREATE TABLE foo (
>> ID IN
ot specified it should reject that
command. Is that possible?
---
DROP TABLE IF EXISTS foo;
CREATE TABLE foo (
ID INTEGER PRIMARY KEY AUTO_INCREMENT,
First VarChar(30),
Last VarChar(30) NOT NULL,
Zip INTEGER
);
INSERT INTO foo (F
If Last is not specified it should reject that
> command. Is that possible?
>
> ---
>
> DROP TABLE IF EXISTS foo;
>
> CREATE TABLE foo (
>ID INTEGER PRIMARY KEY AUTO_INCREMENT,
>First VarChar
ct that
command. Is that possible?
---
DROP TABLE IF EXISTS foo;
CREATE TABLE foo (
ID INTEGER PRIMARY KEY AUTO_INCREMENT,
First VarChar(30),
Last VarChar(30) NOT NULL,
Zip INTEGER
);
INSERT INTO foo (First, Last, Zip)
Hello Nils and Jerry,
Thanks you for your quick reply!
IMO, using trigger looks cleaner and prettier than Excel-like
if(char_length) hack
so I will probably give triggers a try.
Searching on the net, I found some articles on check constraints in MySQL.
http://gilfster.blogspot.com/2005/11/check
Hi Js,
js wrote:
Is there any easy way to implement 'NOT EMPTY' constraint?
There currently is no support for CHECK Constraints in MySQL, at least
to my knowing. So you'd have to go with a trigger.
regards
Nils
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To
rds,
Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
> -Original Message-
> From: js [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 12, 2007 11:09 AM
> To: Rolando Edwards
> Cc: mysql@lists.mysql.com
the table like below.
##
mysql> create table t (a char(10) not null);
create table t (a char(10) not null);
Query OK, 0 rows affected (0.07 sec)
mysql> insert into t values(NULL);
insert into t values(NULL);
ERROR 1048 (23000): Column 'a' cannot be null
######
Have a look at the HAVING clause ...
- Original Message -
From: "js " <[EMAIL PROTECTED]>
To:
Sent: Monday, February 12, 2007 2:48 PM
Subject: NOT EMPTY, like NOT NULL
Hi list,
A silly question.
Is it possible to prevent empty value('') from appearing in
ldname='','Empty Value of Your Choice',fieldname)) FROM
Give it a try, it's Worth a Shot !!!
- Original Message -
From: "js" <[EMAIL PROTECTED]>
To: mysql@lists.mysql.com
Sent: Monday, February 12, 2007 9:48:28 AM (GMT-0500) US/Eastern
Subject: NOT EMPT
Hi list,
A silly question.
Is it possible to prevent empty value('') from appearing in a field?
I can solve this by using subquery or trigger,
but it's a little bit painful.
The simpler the better :)
Thanks.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsub
> I need to create a "commands" table. A program will periodically check
on this table whether
> there's a pending command for it to execute or not. Whatever the reason,
this program might read a command but not acknowledge it's
> execution.
> Other program will check out whether the command t
10/04/2006 11:51
Para: <[EMAIL PROTECTED]>,
Asunto: Re: timestamp & not null
Hi,
> I created a table and, into it, a timestamp field:
> ... EXPIRES TIMESTAMP NOT NULL, ...
>
> When I issue the command "describe" it shows the field "expires" allows
nul
Hi,
> I created a table and, into it, a timestamp field:
> ... EXPIRES TIMESTAMP NOT NULL, ...
>
> When I issue the command "describe" it shows the field "expires" allows
nulls and defaults to CURRENT_TIMESTAMP. Also, each time I update
> a field other than &quo
Hi!
I created a table and, into it, a timestamp field:
... EXPIRES TIMESTAMP NOT NULL, ...
When I issue the command "describe" it shows the field "expires" allows nulls
and defaults to CURRENT_TIMESTAMP. Also, each time I update
a field other than "expires"
Danny Stolle <[EMAIL PROTECTED]> wrote on 01/23/2006 01:34:01 PM:
> Hi,
>
> I am often running into this type of design, but would it be a good
> design. Normally you design tables related to each other and having e.g.
> parameter tables like a country-table holding country names with their
>
Hi,
I am often running into this type of design, but would it be a good
design. Normally you design tables related to each other and having e.g.
parameter tables like a country-table holding country names with their
country-id's; and you will find these country-ids back in other tables,
which
abase. The new server is
>running MySQL 5.0.
>
>Trying to import a table such as
>
>CREATE DATABASE /*!32312 IF NOT EXISTS*/ db17058c;
>USE db17058c;
>DROP TABLE IF EXISTS adidas;
>CREATE TABLE adidas (
> manufacturer char(1) NOT NULL default '',
>
adidas;
CREATE TABLE adidas (
manufacturer char(1) NOT NULL default '',
brand char(1) NOT NULL default '',
product varchar(100) NOT NULL default '',
short text NOT NULL,
long text NOT NULL,
id int(11) NOT NULL default '0',
image varchar(124) NO
Hi!
LMS wrote:
Jeff Smelser escribió:
On Wednesday 26 October 2005 04:24 pm, LMS wrote:
Hi,
I have this structure:
---
CREATE TABLE tabla (
id int(10) unsigned NOT NULL auto_increment,
nombre varchar(100) NOT NULL default '',
be
Jeff Smelser escribió:
On Wednesday 26 October 2005 04:24 pm, LMS wrote:
Hi,
I have this structure:
---
CREATE TABLE tabla (
id int(10) unsigned NOT NULL auto_increment,
nombre varchar(100) NOT NULL default '',
because your defaul
On Wednesday 26 October 2005 04:24 pm, LMS wrote:
> Hi,
> I have this structure:
> ---
> CREATE TABLE tabla (
>id int(10) unsigned NOT NULL auto_increment,
>nombre varchar(100) NOT NULL default '',
because your d
Hi,
I have this structure:
---
CREATE TABLE tabla (
id int(10) unsigned NOT NULL auto_increment,
nombre varchar(100) NOT NULL default '',
PRIMARY KEY (id),
UNIQUE KEY nombre (nombre),
UNIQUE KEY id (id)
) ENGINE=MyISAM;
SELECT *
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
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, 20
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_details
(user_id varchar
Hi,
> > '' or empty string is not a null in mysql. This is
> > true for Oracle !
> > this simple test lets you understand :
> >
> > * Without NULLs
> > mysql> create table notnull (t varchar(10) NOT
> > NULL);
> >
Hi,
'' or empty string is not a null in mysql. This is true for Oracle !
this simple test lets you understand :
* Without NULLs
mysql> create table notnull (t varchar(10) NOT NULL);
Query OK, 0 rows affected (0.14 sec)
mysql> insert into notnull values('tes
Ashok Kumar wrote:
Hi friends,
I'm having one doubt on "NOT NULL" specification for
the table field properties. That is i have created on
table-mine which contains name(Not Null) and pwd(Not
Null). Now I intended to execute the following query.
"insert into mine values(
Hi friends,
I'm having one doubt on "NOT NULL" specification for
the table field properties. That is i have created on
table-mine which contains name(Not Null) and pwd(Not
Null). Now I intended to execute the following query.
"insert into mine values('',''
> > create table a (
> > b int not null,
> >c int null
> >primary_key(b,c)
> > );
> >
> > With values:
> > 1 null
> > 1 null
> >
> > Logically these are unique records under the standard proviso that
> > null != n
From: <[EMAIL PROTECTED]>
> create table a (
> b int not null,
>c int null
>primary_key(b,c)
> );
>
> With values:
> 1 null
> 1 null
>
> Logically these are unique records under the standard proviso that
> null != null. Yet how could I unique
>
>no sql errors.
>
>Next snytax error I get is:
>Create table 'testime' ( 'teatime' timestamp NOT NULL default
>CURRENT_TIMESTAMP on update
>CURRENT_TIMESTAMP,
> 'val' char(22) NOT Null);
>
a good reason other than "because our ancestors always did it
>this way".
Let's look at it from a pure logic point of view. Given the table:
create table a (
b int not null,
c int null
primary_key(b,c)
);
With values:
1 null
1 null
Logica
latin1;
I get a sql error telling me to check the syntax for this version.
I modified the line to
ENGINE=MYISAM CHARSET=latin1;
no sql errors.
Next snytax error I get is:
Create table 'testime' ( 'teatime' timestamp NOT NULL default CURRENT_TIMESTAMP
on update CURRENT_TI
From: "Frank Bax"
> At 11:07 AM 4/27/05, Jigal van Hemert wrote:
> >So, if we would define that the key entry "0-NULL-Whatever" equals
> >"0-NULL-Whatever" (which MySQL is capable of if you look at the
definition
> >of UNIQUE indexes with BDB tables) then allowing NULLs as part of a key
> >entry w
ing to use NULL for.
Let me add an aspect which I did not find mentioned yet:
The SQL syntax differs for NULL and non-NULL values!
As long as your key columns have the "NOT NULL" property, you can alwas
say "WHERE keycol = value".
When you qualify by a NULL value, you need to sa
uld not permit duplicate entries. At least not more than allowing
other values.
Because there is a considerable performance difference between primary and
secudary keys in InnoDB it would enable more flexible primary keys that can
also be used for searching.
It would mean breaking with the standar
At 11:07 AM 4/27/05, Jigal van Hemert wrote:
So, if we would define that the key entry "0-NULL-Whatever" equals
"0-NULL-Whatever" (which MySQL is capable of if you look at the definition
of UNIQUE indexes with BDB tables) then allowing NULLs as part of a key
entry would not permit duplicate entries
lues.
Because there is a considerable performance difference between primary and
secudary keys in InnoDB it would enable more flexible primary keys that can
also be used for searching.
It would mean breaking with the standard (PRIMARY = UNIQUE + NOT NULL), so
it's not likely that it will e
Jigal
>Anyway, I gues it's just a question of following a standard and
optimizing
>the engine according to that standard.
Your proposal would permit dupe primary keys. It's a question of
preventing them.
PB
-
Jigal van Hemert wrote:
From: "Mikhail Entaltsev"
Mikhail,
Bef
> > [snip]
> > The same is true for any other value... Now that the columns have a NOT
> > NULL
> > constraint the records that previously contained NULL now hold '0'.
> >
> > x y
> > x 0
> > x z
> > x 0
> >
> > Now
On 4/26/05, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> The same is true for any other value... Now that the columns have a NOT
> NULL
> constraint the records that previously contained NULL now hold '0'.
>
> x y
> x 0
> x z
> x 0
>
>
From: "Mikhail Entaltsev"
Mikhail,
> Before inserting MySQL will try to find a record with the same values.
> But since comparison with NULL value returns always FALSE
> MySQL will think that there is no such record in the table.
> After this point you will get 2 identical records in the table.
; mysql@lists.mysql.com
Subject: Re: why NOT NULL in PRIMARY key??
> Not every DBMS...
>
> MSSQL:
> Create Unique Index
> Microsoft(r) SQL Server(tm) checks for duplicate values when the index
> is created (if data already exists) and checks each time data is added
> with an INSER
On 4/26/05, Jigal van Hemert wrote:
> From: "Jochem van Dieten"
>>> Why is this?
>>
>> Because the SQL standard says so.
>
> A true observation, but still no explanation or reason why ;-P
I consider it a good enough explanation of why MySQL doesn't allow it.
As to why the SQL standard doesn't al
> > >I would understand it if it would mean that the key as a whole could
not
> be
> > >NULL, but the restriction that each column that is part of a PRIMARY
KEY
> > >must have the NOT NULL constraint is not logical.
> >
> > Sure it is. If any part coul
In article <[EMAIL PROTECTED]>,
"Jigal van Hemert" <[EMAIL PROTECTED]> writes:
> From: "Harald Fuchs"
>> > id INT(11) - accountID
>> > name VARCHAR(32) - parameter name
>> > value INT(11) - parameter value
>>
>> > Other tables contain string, datetime, etc. parameters.
>>
>> > Since most searche
[snip]
The same is true for any other value... Now that the columns have a NOT
NULL
constraint the records that previously contained NULL now hold '0'.
x y
x 0
x z
x 0
Now, how do you uniquely identify the 2nd and 4th rows?
[/snip]
The database would have thrown an error when yo
ines a PRIMARY KEY as a combination
>between UNIQUE and NOT NULL, but it's still not clear to me why
>this implies that all *parts*
of the primary key *must* also have the
>NOT NULL constraint.
Allow NULLs as PK components and you destroy two things at once, PK
logic and performanc
From: "Paul DuBois"
> >I would understand it if it would mean that the key as a whole could not
be
> >NULL, but the restriction that each column that is part of a PRIMARY KEY
> >must have the NOT NULL constraint is not logical.
>
> Sure it is. If any part co
khail.
- Original Message -
From: "Jigal van Hemert" <[EMAIL PROTECTED]>
To: "Dawid Kuroczko" <[EMAIL PROTECTED]>
Cc:
Sent: Tuesday, April 26, 2005 4:47 PM
Subject: Re: why NOT NULL in PRIMARY key??
> From: "Dawid Kuroczko"
>
> > > It can&
e-account_id. InnoDB is very fast if you use the primary
key and a lot slower if you use secudary key(s), so queries can get
considerably faster if you use a primary key.
My combined key would be able to uniquely identify records. I know the SQL
standard defines a PRIMARY KEY as a combination between UNI
"Jigal van Hemert" <[EMAIL PROTECTED]> wrote on 04/26/2005 10:35:06 AM:
> From: "Harald Fuchs"
>
> > > id INT(11) - accountID
> > > name VARCHAR(32) - parameter name
> > > value INT(11) - parameter value
> >
> > > Other tables contain string, datetime, etc. parameters.
> >
> > > Since most search
se SELECT statements will
> > return exactly one (different) row.
> With the NULL values included it will still uniquely identify each row...
>
> I would understand it if it would mean that the key as a whole could not
be
> NULL, but the restriction that each column that is part of
these SELECT statements will
return exactly one (different) row.
With the NULL values included it will still uniquely identify each row...
I would understand it if it would mean that the key as a whole could not be
NULL, but the restriction that each column that is part of a PRIMARY KEY
must have
er if you use a primary key.
My combined key would be able to uniquely identify records. I know the SQL
standard defines a PRIMARY KEY as a combination between UNIQUE and NOT NULL,
but it's still not clear to me why this implies that all *parts* of the
primary key *must* also have the NOT NULL cons
tements will
> return exactly one (different) row.
With the NULL values included it will still uniquely identify each row...
I would understand it if it would mean that the key as a whole could not be
NULL, but the restriction that each column that is part of a PRIMARY KEY
must have the NOT NULL
ently converted all "NULL"
constraints to "NOT NULL" for the columns that are part of the primary key
and converted all NULL values in the db to the appropriate default values
for the various column types.
Regards, Jigal.
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MyS
From: "Jochem van Dieten"
> > Why is this?
>
> Because the SQL standard says so.
A true observation, but still no explanation or reason why ;-P
MySQL doesn't follow the standard in every situation, so that's not an
excuse... (no offense!)
There must be a good reason other than "because our ancesto
> > A primary key absolutely forbids duplicate values.
> >
> > Indexes created with the UNIQUE keyword do not allow duplicates, except
> > for the special case that multiple NULL values are allowed.
>
> I realise that it may (and is) defined in such a way, but it still does
not
> explain *why* par
On 4/26/05, Jigal van Hemert <[EMAIL PROTECTED]> wrote:
> And http://dev.mysql.com/doc/mysql/en/create-table.html tells me that "A
> PRIMARY KEY is a unique KEY where all key columns must be defined as NOT
> NULL. If they are not explicitly declared as NOT NULL, MySQL declares
From: "Harald Fuchs"
> > id INT(11) - accountID
> > name VARCHAR(32) - parameter name
> > value INT(11) - parameter value
>
> > Other tables contain string, datetime, etc. parameters.
>
> > Since most searches are made for a value (or range) of one or more
> > parameters, a usable primary key is:
> Not every DBMS...
>
> MSSQL:
> Create Unique Index
> Microsoft(r) SQL Server(tm) checks for duplicate values when the index
> is created (if data already exists) and checks each time data is added
> with an INSERT or UPDATE statement. If duplicate key values exist, the
> CREATE INDEX statement
iderably.
Some queries turned out to be quite slow and we found that these relied on
NULL values. Converting the index to primary silently converted all "NULL"
constraints to "NOT NULL" for the columns that are part of the primary key
and converted all NULL values in the db to
In article <[EMAIL PROTECTED]>,
"Jigal van Hemert" <[EMAIL PROTECTED]> writes:
> From: "Martijn Tonies"
>> Ehm... it might be me - but what sense does it make to have a NULL
>> in a PK?
>> If you "need" this, then your primary key probably isn't a primary key.
>>
>> Care to explain why and how yo
At 15:20 +0200 4/26/05, Jigal van Hemert wrote:
From: "Jay Blanchard"
Since NULL is the absence of a value and PRIMARY keys must have a value
a NULL column cannot be included as a portion of a PRIMARY key. AFAIK
this is the case with every RDBMS out there. Asking the development team
might get
From: "Martijn Tonies"
> Ehm... it might be me - but what sense does it make to have a NULL
> in a PK?
> If you "need" this, then your primary key probably isn't a primary key.
>
> Care to explain why and how you're designing your database?
Martijn,
The table contains an variable number of integ
-index.html
=
If you do not define a PRIMARY KEY for your table, MySQL picks the first
UNIQUE index that has only NOT NULL columns as the primary key and InnoDB
uses it as the clustered index. If there is no such index in the table,
InnoDB internally
At 08:49 AM 4/26/05, Jay Blanchard wrote:
[snip]
http://dev.mysql.com/doc/mysql/en/silent-column-changes.html
mentions that "Columns that are part of a PRIMARY KEY are made NOT NULL
even
if not declared that way. "
And http://dev.mysql.com/doc/mysql/en/create-table.html tells me that
On 4/26/05, Jigal van Hemert wrote:
> http://dev.mysql.com/doc/mysql/en/silent-column-changes.html
> mentions that "Columns that are part of a PRIMARY KEY are made NOT NULL even
> if not declared that way. "
>
> And http://dev.mysql.com/doc/mysql/en/create-table.html t
From: "Jay Blanchard"
> Since NULL is the absence of a value and PRIMARY keys must have a value
> a NULL column cannot be included as a portion of a PRIMARY key. AFAIK
> this is the case with every RDBMS out there. Asking the development team
> might get you a more informative response.
>
> There
> http://dev.mysql.com/doc/mysql/en/silent-column-changes.html
> mentions that "Columns that are part of a PRIMARY KEY are made NOT NULL
even
> if not declared that way. "
>
> And http://dev.mysql.com/doc/mysql/en/create-table.html tells me that "A
> PRIMARY
PROTECTED]
Sent: Tuesday, April 26, 2005 6:50 AM
To: Jigal van Hemert; mysql@lists.mysql.com
Subject: RE: why NOT NULL in PRIMARY key??
Since NULL is the absence of a value and PRIMARY keys must have a value
a NULL column cannot be included as a portion of a PRIMARY key. AFAIK
this is the case
[snip]
http://dev.mysql.com/doc/mysql/en/silent-column-changes.html
mentions that "Columns that are part of a PRIMARY KEY are made NOT NULL
even
if not declared that way. "
And http://dev.mysql.com/doc/mysql/en/create-table.html tells me that "A
PRIMARY KEY is a unique KEY where
http://dev.mysql.com/doc/mysql/en/silent-column-changes.html
mentions that "Columns that are part of a PRIMARY KEY are made NOT NULL even
if not declared that way. "
And http://dev.mysql.com/doc/mysql/en/create-table.html tells me that "A
PRIMARY KEY is a unique KEY where all key
Your tables aren't setup very well. You should google for
normalization and 'boyce codd normal form'
-Eric
On Sat, 16 Oct 2004 22:27:51 +0200, owca <[EMAIL PROTECTED]> wrote:
> I'm trying get current week, starting from monday to sunday:
>
> select UNIX_TIMESTAMP(day), g15, g16, g17, g18, g19,
I'm trying get current week, starting from monday to sunday:
select UNIX_TIMESTAMP(day), g15, g16, g17, g18, g19, g20, g21, g22, id
from tydzien where to_days(day) between
to_days(now())- mod(to_days(now()),7)+2 /*some parameter setting a starting
day*/ and
(to_days(now())- mod(to_days(now()),7)
nt of dirty data between different systems.
Be careful when not including NOT NULL columns in your inserts...
To get around the problem and get more background info, read:
http://dev.mysql.com/doc/mysql/en/constraint_NOT_NULL.html
Regards,
Thomas Lundström, Ongame E-Solutions AB
-Ori
can successfully insert rows into a table without
including a value for a column
which should be blocking nulls.
e.g.
Table A
id (PK, auto increment)
name
type
ssn ( nulls allowed specified)
==> name and type do not have nulls allowed specified, so I think they
should be NOT N
- 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 col
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
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 that summarises it
all.
---
Justin F
Ja! Most RDBMS don't use default values for NOT NULL columns. Rather
they alarm if a statement renders such fields NULL.
I do agree with Michael. Mysql went a different way in this regard, in
that it assigns default values... It only warns if one tries to
explicitly enter "NULL&qu
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 val
1 - 100 of 247 matches
Mail list logo