--- [EMAIL PROTECTED] wrote:

> I am using phpmyadmin and I want to add a new field and then set the
> defualt value to all the values to "a". How do I do a mass insert and
> not just create a big empty table row?
> 
> 
> The filed is called AREA it is a varchar of LENGTH 5 it should be NOT
> NULL and have a default value of "a"
> 
> This is fine when I create the field and add new entries but the old
> ones have a nothing in them.
> 
> Thanks,
> 
> 
> Ross


Two and a half questions:

a) do you have a DEFAULT value for your field? If you do then the next
time you insert a null to that field (or omit it from an insert
statement) it will gain that value.

CREATE TABLE ...
...
, AREA VARCHAR(5) DEFAULT 'a'
... )

b) have you tried this to reset your null values?

UPDATE yourtablename SET area='a' where area is NULL or area='';

b.5) Are you trying to ADD a column or manage an existing one. Your
post was not very clear

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to