469,644 Members | 1,696 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,644 developers. It's quick & easy.

Updating Column Descriptions (Comments)

Hello all,

Looking for some help here. BTW, to e-mail me directly, should you
prefer, take the *nomail*. out the reply address.

I uploaded data from another program ( GNU R-2.2.0 @ www.r-project.org )
into a MySQl (4.1.X ) database. R generated the tables for me, naming
the columns, setting field types, and inserting the records. This is
good, as it was about 100MB of data across 13 tables, each with between
50 and 200 fields in each table.

The original data file also has field descriptions, long comments
describing the contents of the column. Unfortunately, R does not add
the appropriate MySQL column comments. So, my question is, how can I
update these comments.

Right now, I have them in a format that would be easy to insert into a
MySQL table. Each comment is a row of data. The columns contain the
field names, which are the same as the field names in the MySQL database.

But, I cannot figure out how and where MySQL stores this metadata. Is
there a table that I can update directly with these values? Any help
would be appreciated.

This is on Linux, Ubuntu Breezy 5.10.

Thanks
Dec 15 '05 #1
1 14913
"Brett Magill" <magillb@*nomail*.sbcglobal.net> wrote in message
news:26******************@newssvr14.news.prodigy.c om...
The original data file also has field descriptions, long comments
describing the contents of the column. Unfortunately, R does not add the
appropriate MySQL column comments. So, my question is, how can I update
these comments.


CREATE TABLE has a syntax for a table option COMMENT = 'string'.
ALTER TABLE can take the same option:

ALTER TABLE myTable COMMENT = 'fee fie fo fum';

Likewise you can add comments to individual columns:

ALTER TABLE myTable CHANGE COLUMN myColumn
myColumn INTEGER COMMENT 'bee bie baz';

(that syntax requires that you first list the column name, and then the
whole column definition, including repeating the column name.)

You can see the comments if you show the table:

SHOW CREATE TABLE myTable;

Regards,
Bill K.
Dec 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Dave Pylatuk | last post: by
9 posts views Thread by DMAC | last post: by
3 posts views Thread by Daniel M | last post: by
1 post views Thread by Max | last post: by
1 post views Thread by Chris Calzaretta | last post: by
33 posts views Thread by bill | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.