Hi,

> I like to chyeck my mysql db's/tables using the unix command line, and
> doing a "select * from table". However some field are very long - varchar
> 255 - is there a way to set the display width when viewing the data. ie -
> so that binary/large text fields are truncated after a few characters.
> That way I would be able to see all the columns clearly.

Although you cannot get the mysql client program to truncate output of BLOB
or TEXT fields, you can get it to output results in a format other than the
default horizontal table style.

If you terminate your query string with '\G' (as opposed to ';' or '\g') you
will get the vertical output format, like so:

mysql> select * from mytable limit 3\G
*************************** 1. row ***************************
category_code: 0
   agent_code: 14427
*************************** 2. row ***************************
category_code: 0
   agent_code: 14562
*************************** 3. row ***************************
category_code: 0
   agent_code: 44114
3 rows in set (0.00 sec)

This has the benefit of long text fields being wrapped on your display.

Regards,

Basil Hussain
---------------------------------------
Internet Developer, Kodak Weddings
E-Mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to