Could someone help this guy :-?

2006-09-09 Thread Behrang Saeedzadeh

Hi,

Could someone help this guy work around this problem in MySQL:
http://www.redhillconsulting.com.au/blogs/simon/archives/000347.html

-Behi

--
We can only see a short distance ahead,
but we can see plenty there
that needs to be done. - Alan Turing

Science is a differential equation. Religion
is a boundary condition - Alan Turing

Behrang Saeedzadeh
http://www.jroller.com/page/behrangsa
http://my.opera.com/behrangsa

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Could someone help this guy :-?

2006-09-09 Thread Paul DuBois

Behrang Saeedzadeh wrote:

Hi,

Could someone help this guy work around this problem in MySQL:
http://www.redhillconsulting.com.au/blogs/simon/archives/000347.html


I think the answer to his questions lies in the manual:

http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html

If a column is NOT NULL and contains no DEFAULT clause in its
definition, the default is the implicit default for the column's
data type.

That's with strict mode disabled; in strict mode, columns with no
DEFAULT clause must be given a value.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Could someone help this guy :-?

2006-09-09 Thread Arjan Hulshoff

Paul DuBois wrote:

Behrang Saeedzadeh wrote:

Hi,

Could someone help this guy work around this problem in MySQL:
http://www.redhillconsulting.com.au/blogs/simon/archives/000347.html


I think the answer to his questions lies in the manual:

http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html

If a column is NOT NULL and contains no DEFAULT clause in its
definition, the default is the implicit default for the column's
data type.

That's with strict mode disabled; in strict mode, columns with no
DEFAULT clause must be given a value.

This behavior sounds pretty logical to me, besides the fact that it is 
designed like that. Why would you try to put a NULL value in a column 
that you explicitly have forbidden to contain NULL values? In my opinion 
you don't know what you are doing when you use a CREATE query in which 
you define a column that can't be NULL and after that add a default 
value of NULL. So it seems logical that MySQL defined a default value 
for every type. So it is not comparable with M$ Access. If he says that 
you can do this with PostgreSQL, then I get the feeling that it is a 
flaw in the software. And might cause unexpected errors in programs. I 
guess I am also biased as I am very fond of MySQL...


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]