Displaying Default Values

2002-10-09 Thread Lawrence S. Stephens III

I am useing mysql  Ver 11.18 Distrib 3.23.52, for pc-linux-gnu (i686). I have 
set up a table in which one of the fields have a default value (i.e. New 
York). When I INSERT a record, that field is empty so that the default value 
is inserted into the field automatically (at least that's what I think).
When I SELECT the all fields, the field with the default value is blank but 
when I SHOW or DESC the table, I can see the default value. Moreover, the 
field is set to NOT NULL.

Has anybody seen this problem? Why I can't display the field's default value 
when execute the SELECT statement?

-- 
Lawrence S. Stephens III

[EMAIL PROTECTED]
Paterson, New Jersey 07514-1711
USA



-
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




Re: Displaying Default Values

2002-10-09 Thread Keith C. Ivey

On 9 Oct 2002, at 13:14, Lawrence S. Stephens III wrote:

 When I INSERT a record, that field is empty so that the default value 
 is inserted into the field automatically (at least that's what I think).

If your query is setting the column to the empty string, then you're 
setting it to the empty string, not the default value.  To get the 
default value (before MySQL 4.0.3), you have to omit that column from 
the INSERT statement:

http://www.mysql.com/doc/en/INSERT.html

-- 
Keith C. Ivey [EMAIL PROTECTED]
Tobacco Documents Online
http://tobaccodocuments.org

-
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