paul rivers wrote:
>> From: owner-micronet-list_at_lists.berkeley.edu [mailto:owner-micronet-
>> list_at_lists.berkeley.edu] On Behalf Of Aaron DuBois
>> Sent: Tuesday, October 02, 2007 11:40 AM
>> To: micronet-list_at_listlink.berkeley.edu
>> Subject: [Micronet] MySQL statement for changing a column name with an
>> illegal character> Alter Table faculty Change `E-mail` email varchar;
>>
>> is not working.
>
> Fully specify the column. What was `e-mail` originally? Nullable? length
> 60? Any defaults? So for example:
>
> ALTER TABLE faculty CHANGE COLUMN `e-mail` email varchar(60) NULL;
>
> Paul
>
>
>
Thanks for the point in the right direction there Paul.
Here is the answer.
alter table faculty change column `E-mail` email varchar(100)
I had to add "column" and put the info for the varchar in ().
Looks like the online documentation is a bit lacking on the details.
" You can rename a column using a CHANGE old_col_name column_definition
clause. To do so, specify the old and new column names and the type
that the column currently has. For example, to rename an INTEGER column
from a to b, you can do this:
ALTER TABLE t1 CHANGE a b INTEGER;"
Is there a webpage that provides more detailed MySQL syntax then the
dev.mysql.com site?
-- Aaron DuBois Sociology Tech 489 Barrows Hall Mon-Fri 8:30am-12:30pm 510-643-9389 Department Web Master Department IST Security Officer Departmental Equipment Custodian ------------------------------------------------------------------------ The following was automatically added to this message by the list server: To learn more about Micronet, including how to subscribe to or unsubscribe from its mailing list and how to find out about upcoming meetings, please visit the Micronet Web site: http://micronet.berkeley.edu/ Messages you send to this mailing list are public and world-viewable, and the list's archives can be browsed and searched on the Internet. This means these messages can be viewed by (among others) your bosses, prospective employers, and people who have known you in the past.Received on Tue Oct 02 2007 - 12:55:47 PDT
This archive was generated by hypermail 2.2.0 : Tue Oct 02 2007 - 12:55:53 PDT