|
Home > Archive > MySQL ODBC Connector > September 2005 > Where to store comments?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Where to store comments?
|
|
| Siegfried Heintze 2005-09-28, 8:24 pm |
| Other databases allow one to store comments describing each field in a table
definition. These are stored in the database. In addition, one can store
comments about the table. Examples include MS SQL Server and MS Access.
Does MySQL have such a feature? Is there a GUI to support it?
What perl or java functions does one use to store and retrieve these
strings?
Thanks,
Siegfried
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw
| |
| Martijn van den Burg 2005-09-28, 8:24 pm |
| On Wednesday 28 September 2005 20:47, Siegfried Heintze wrote:
> Other databases allow one to store comments describing each field in a
> table definition. These are stored in the database. In addition, one can
> store comments about the table. Examples include MS SQL Server and MS
> Access.
>
> Does MySQL have such a feature? Is there a GUI to support it?
Short answer: yes.
Long answer: http://dev.mysql.com/doc/mysql/en/create-table.html
I guess that MySQLCC or MySQL Administrator could deal with this, but I'm not
sure since I orefer the command line :)
> What perl or java functions does one use to store and retrieve these
> strings?
I haven't tried, but I suppose that you could retrieve the table information
(using the SQL statement 'SHOW CREATE TABLE') and parse the resulting text in
some way.
Regards,
--
</Martijn>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw
| |
| Jonas Geiregat 2005-09-29, 8:23 pm |
| Martijn van den Burg wrote:
>On Wednesday 28 September 2005 20:47, Siegfried Heintze wrote:
>
>
>
>Short answer: yes.
>Long answer: http://dev.mysql.com/doc/mysql/en/create-table.html
>
>I guess that MySQLCC or MySQL Administrator could deal with this, but I'm not
>sure since I orefer the command line :)
>
>
>
Doesn't seem to work here,
mysql> create table foo (id int NOT NULL comment 'test foo en bar');
Query OK, 0 rows affected (0.02 sec)
mysql> show create table foo;
+-------+------------------------------------------------------------------------+
| Table | Create
Table |
+-------+------------------------------------------------------------------------+
| foo | CREATE TABLE `foo` (
`id` int(11) NOT NULL default '0'
) TYPE=MyISAM |
+-------+------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> desc foo;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id | int(11) | | | 0 | |
+-------+---------+------+-----+---------+-------+
1 row in set (0.00 sec)
mysql> select version();
+-----------+
| version() |
+-----------+
| 4.0.25 |
+-----------+
1 row in set (0.00 sec)
mysql>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw
| |
| Logan, David 2005-09-29, 8:23 pm |
| Hi Jonas,
From the manual=20
A comment for a column can be specified with the COMMENT option. The
comment is displayed by the SHOW CREATE TABLE and SHOW FULL COLUMNS
statements. This option is operational as of MySQL 4.1. (It is allowed
but ignored in earlier versions.)=20
Regards
David Logan
Database Administrator
HP Managed Services
148 Frome Street,
Adelaide 5000
Australia
+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 - Fax
-----Original Message-----
From: Jonas Geiregat [mailto:yux@sdf-eu.org]=20
Sent: Friday, 30 September 2005 12:20 PM
To: Martijn van den Burg
Cc: mysql@lists.mysql.com; Siegfried Heintze
Subject: Re: Where to store comments?
Martijn van den Burg wrote:
>On Wednesday 28 September 2005 20:47, Siegfried Heintze wrote:
> =20
>
can[color=darkred]
>
>Short answer: yes.
>Long answer: http://dev.mysql.com/doc/mysql/en/create-table.html
>
>I guess that MySQLCC or MySQL Administrator could deal with this, but
I'm not=20
>sure since I orefer the command line :)
>
> =20
>
Doesn't seem to work here,
mysql> create table foo (id int NOT NULL comment 'test foo en bar');
Query OK, 0 rows affected (0.02 sec)
mysql> show create table foo;
+-------+---------------------------------------------------------------
---------+
| Table | Create=20
Table |
+-------+---------------------------------------------------------------
---------+
| foo | CREATE TABLE `foo` (
`id` int(11) NOT NULL default '0'
) TYPE=3DMyISAM |
+-------+---------------------------------------------------------------
---------+
1 row in set (0.00 sec)
mysql> desc foo;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id | int(11) | | | 0 | |
+-------+---------+------+-----+---------+-------+
1 row in set (0.00 sec)
mysql> select version();
+-----------+
| version() |
+-----------+
| 4.0.25 |
+-----------+
1 row in set (0.00 sec)
mysql>
--=20
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: =
http://lists.mysql.com/mysql?unsub=3Ddavid.logan@hp.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw
| |
| Harald Fuchs 2005-09-30, 7:23 am |
| In article <433CA7BD.2080902@sdf-eu.org>,
Jonas Geiregat <yux@sdf-eu.org> writes:
mysql> create table foo (id int NOT NULL comment 'test foo en bar');
This is a comment on a column which apparently gets displayed by SHOW
CREATE TABLE only by later versions, e.g. 4.1.14. Table comments go
after the closing parenthesis:
create table foo (id int NOT NULL) comment 'test foo en bar';
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw
|
|
|
|
|