Re: describe table : improvement

2006-04-22 Thread mysql
Thankyou Michael.

I'm trying to work my way through the 5.0.18/19 manual, but 
I seem to have missed that.

Regards

Keith 

In theory, theory and practice are the same;
in practice they are not.

On Sat, 22 Apr 2006, Michael Stassen wrote:

> To: [EMAIL PROTECTED]
> From: Michael Stassen <[EMAIL PROTECTED]>
> Subject: Re: describe table : improvement
> 
> [EMAIL PROTECTED] wrote:
> > Thankyou Gabriel.
> > 
> > So how does one set a column comment then?
> > 
> > Regards
> > 
> > Keith
> 
> As part of the column definition, as documented in the manual
> <http://dev.mysql.com/doc/refman/5.0/en/create-table.html>.
> 
> column_definition:
> col_name type [NOT NULL | NULL] [DEFAULT default_value]
> [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY]
> [COMMENT 'string'] [reference_definition]
> 
> Michael

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



Re: describe table : improvement

2006-04-21 Thread Michael Stassen

[EMAIL PROTECTED] wrote:

Thankyou Gabriel.

So how does one set a column comment then?

Regards

Keith


As part of the column definition, as documented in the manual 
.


  column_definition:
col_name type [NOT NULL | NULL] [DEFAULT default_value]
[AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY]
[COMMENT 'string'] [reference_definition]

Michael

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



Re: [SPAM] Re: describe table : improvement

2006-04-20 Thread mysql
Thankyou Gabriel.

So how does one set a column comment then?

Regards

Keith

In theory, theory and practice are the same;
in practice they are not.

On Thu, 20 Apr 2006, Gabriel PREDA wrote:

> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> From: Gabriel PREDA <[EMAIL PROTECTED]>
> Subject: [SPAM] Re: describe table : improvement
> 
> COLUMN COMMENTs are not the same as TABLE COMMENT...
> 
> For TABLE COMMENT you should use:
> 
> SHOW TABLE STATUS LIKE 'table_name'
> 
> *Gilles *(the starter of the thread) wanted COLUMN COMMENTs.
> 
> --
> Gabriel PREDA
> Senior Web Developer

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



Re: describe table : improvement

2006-04-20 Thread Gabriel PREDA
COLUMN COMMENTs are not the same as TABLE COMMENT...

For TABLE COMMENT you should use:

SHOW TABLE STATUS LIKE 'table_name'

*Gilles *(the starter of the thread) wanted COLUMN COMMENTs.

--
Gabriel PREDA
Senior Web Developer


Re: describe table : improvement

2006-04-20 Thread mysql

Using MySQL 5.0.18

mysql> use test1;
Database changed
mysql> show tables;
+-+
| Tables_in_test1 |
+-+
| t1  |
+-+
1 row in set (0.00 sec)

mysql> show create table t1 \G
* 1. row *
   Table: t1
Create Table: CREATE TABLE `t1` (
  `ID` int(11) NOT NULL auto_increment,
  `set1` varchar(30) default NULL,
  `col2` char(20) default NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='test1.t1 test table'
1 row in set (0.00 sec)


mysql> show full columns from t1 \G
* 1. row *
 Field: ID
  Type: int(11)
 Collation: NULL
  Null: NO
   Key: PRI
   Default: NULL
 Extra: auto_increment
Privileges: select,insert,update,references
   Comment:
* 2. row *
 Field: set1
  Type: varchar(30)
 Collation: latin1_swedish_ci
  Null: YES
   Key:
   Default: NULL
 Extra:
Privileges: select,insert,update,references
   Comment:
* 3. row *
 Field: col2
  Type: char(20)
 Collation: latin1_swedish_ci
  Null: YES
   Key:
   Default: NULL
 Extra:
Privileges: select,insert,update,references
   Comment:
3 rows in set (0.00 sec)

For some reason the

mysql> show full columns from t1 \G

command is not returning the Comment field for me. Is there 
a variable that needs setting to enable this?

Regards

Keith

In theory, theory and practice are the same;
in practice they are not.

On Thu, 20 Apr 2006, Gilles MISSONNIER wrote:

> To: Gabriel PREDA <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> From: Gilles MISSONNIER <[EMAIL PROTECTED]>
> Subject: Re: describe table : improvement
> 
> hello,
> thank you for your answer, but
> 
> this DO NOT work for me. I use MySQL 4.0.24 [ Linux Debian sarge stable ].
> 
> the "FULL" argument displays ONLY the Privileges, NOT the Comment, neither
> Collation.
> 
> 
> mysql> CREATE TABLE a_table (a_column CHAR(30) COMMENT
> mysql> 'commentaire');
> Query OK, 0 rows affected (0.03 sec)
> 
> mysql> SHOW FULL COLUMNS FROM a_table;
> +--+--+--+-+-+---+-+
> | Field| Type | Null | Key | Default | Extra | Privileges
> | |
> +--+--+--+-+-+---+-+
> | a_column | char(30) | YES  | | NULL|   |
> | select,insert,update,references |
> +--+--+--+-+-+---+-+
> 1 row in set (0.03 sec)
> 
> 
> It seems this is a feature available for a more recent release.
> 
> Is this right ?
> 
> 
> 
> 
> On Wed, 19 Apr 2006, Gabriel PREDA wrote:
> 
> > It is:
> > 
> > SHOW FULL COLUMNS FROM a_table
> > 
> > You will get 2 extra columns:
> > 
> > - Privileges (showing the privileges of the user for that column)
> > - Comment (showing a per column comment)
> > 
> > When creating a table you can add a comment using COMMENT keyword:
> > 
> > CREATE TABLE a_table
> > (
> > a_column CHAR(30) CHARSET utf8 COMMENT 'Some comment'
> > ) ;
> > 
> > Is this... what you needed ?
> > 
> > --
> > Gabriel PREDA
> > Senior Web Developer
> > 
> 
> =_==_==_==_==_==_=
> =¯==¯==¯==¯==¯==¯=
> Gilles Missonnier
> IAP - [EMAIL PROTECTED]
> 01 44 32 81 36
> 
> 

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

Re: describe table : improvement

2006-04-20 Thread Gabriel PREDA
Sorry forgot to mention MySQL version 4.1.X


> This option is operational as of MySQL 4.1. (It is allowed but ignored in
> earlier versions.)


--
Gabriel PREDA
Senior Web Developer


Re: describe table : improvement

2006-04-20 Thread Gilles MISSONNIER

hello,
thank you for your answer, but

this DO NOT work for me. I use MySQL 4.0.24 [ Linux Debian sarge stable ].

the "FULL" argument displays ONLY the Privileges, NOT the Comment, neither 
Collation.



mysql> CREATE TABLE a_table (a_column CHAR(30) COMMENT 'commentaire');
Query OK, 0 rows affected (0.03 sec)

mysql> SHOW FULL COLUMNS FROM a_table;
+--+--+--+-+-+---+-+
| Field| Type | Null | Key | Default | Extra | Privileges   
   |
+--+--+--+-+-+---+-+
| a_column | char(30) | YES  | | NULL|   | 
select,insert,update,references |
+--+--+--+-+-+---+-+
1 row in set (0.03 sec)


It seems this is a feature available for a more recent release.

Is this right ?




On Wed, 19 Apr 2006, Gabriel PREDA wrote:


It is:

SHOW FULL COLUMNS FROM a_table

You will get 2 extra columns:

  - Privileges (showing the privileges of the user for that column)
  - Comment (showing a per column comment)

When creating a table you can add a comment using COMMENT keyword:

CREATE TABLE a_table
(
a_column CHAR(30) CHARSET utf8 COMMENT 'Some comment'
);

Is this... what you needed ?

--
Gabriel PREDA
Senior Web Developer



=_==_==_==_==_==_=
=¯==¯==¯==¯==¯==¯=
Gilles Missonnier
IAP - [EMAIL PROTECTED]
01 44 32 81 36

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

Re: describe table : improvement

2006-04-19 Thread Mark Leith

Hi,

Gabriel PREDA wrote:

It is:

SHOW FULL COLUMNS FROM a_table

You will get 2 extra columns:

   - Privileges (showing the privileges of the user for that column)
   - Comment (showing a per column comment)

  

As well as "Collation" (the columns collation).

When creating a table you can add a comment using COMMENT keyword:

CREATE TABLE a_table
(
a_column CHAR(30) CHARSET utf8 COMMENT 'Some comment'
);

Is this... what you needed ?

--
Gabriel PREDA
Senior Web Developer

  

Best regards

Mark

--
Mark Leith, Support Engineer
MySQL AB, Worcester, England, www.mysql.com
Are you MySQL certified?  www.mysql.com/certification


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



Re: describe table : improvement

2006-04-19 Thread Gabriel PREDA
It is:

SHOW FULL COLUMNS FROM a_table

You will get 2 extra columns:

   - Privileges (showing the privileges of the user for that column)
   - Comment (showing a per column comment)

When creating a table you can add a comment using COMMENT keyword:

CREATE TABLE a_table
(
a_column CHAR(30) CHARSET utf8 COMMENT 'Some comment'
);

Is this... what you needed ?

--
Gabriel PREDA
Senior Web Developer


describe table : improvement

2006-04-19 Thread Gilles MISSONNIER


Hello

I run MySql 4.0.24 [ the release for the Debian stable Linux ].

when I do a "describe a_table", it displays the 6 following columns :

Field - Type - Null - Key - Default - Extra


It would be nice if I could have a 7th column for a "comment"
that could be used to describe the meaning of a field.
"Extra" is to be used for other info.


I could make a table especially for this purpose :
create table comment (field varchar, comment varchar);
but this will end into inconsistency at last [ 2 times the same field ]...

Any ideas ?

cheers.

=
Gilles Missonnier
IAP - [EMAIL PROTECTED]

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



Re: describe table : improvement ?

2006-02-18 Thread Gabriel PREDA
U can use instead of
*DESCRIBE a_table*
**
Another syntax: *show [full] columns from `a_table`*

Without FULL it will act like *DESCRIBE a_table *but with FULL option you
will get the comments on the column... and also another beautiful column
witch will show you the privileges you have for each column !

Good luck !

--
Gabriel PREDA
Senior Web Developer
**



On 2/17/06, Gilles MISSONNIER <[EMAIL PROTECTED]> wrote:
>
> when I do a "describe a_table", it displays :
> | Field | Type | Null | Key | Default | Extra |



I would like to have a "Comment" that would show
> the meaning of a field.


describe table : improvement ?

2006-02-17 Thread Gilles MISSONNIER

Hello

when I do a "describe a_table", it displays :
| Field | Type | Null | Key | Default | Extra |

I would like to have a "Comment" that would show
 the meaning of a field. "Extra" is to be used for othe info.


I looked around at :
http://se2.php.net/manual/en/function.mysql-field-name.php

but could not figure out how to do what I want.

I could make a table especially for this purpose :
create table comment (field varchar, comment varchar);
but this will end into inconsistency at last [ 2 times the same field ]...

I run MySql 4.0.24

Any ideas ?

cheers my-folks !

=
Gilles Missonnier
IAP - [EMAIL PROTECTED]

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