Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set the column width when query

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Could anyone show me the command to set the column width please?

I have a table with a few columns and each columns is taking too much spaces, which cause the data select jumping into 2-3 lines according to the header columns. If these columns width can be adjusted so that the query only display all columns in 1 row it will be easier to see the data than spanding into 2-3 rows.

I can do this in Oracle, but don't know the Sybase command to do this

Thanks
 
There are two approaches to this that I use a lot, depending upon the nature of the problem:

1. Shorten the label.

For instance if the column's name is customer_has_service_account but the data type is a bit, then, the column name is the problem. Rename the column:

select ..., customer_has_service_account as "serv", ...

2. Shorten the data.

If the data is normally pretty short (or you only need to see the beginning of it) but the column width is wide, then you can use substring to shorten it:

select ..., substring (cust_name, 1, 20) as "cust_name", ...

HTH, J M Craig
Alpha-G Consulting, LLC
nsjmcraig@netscape.net
 
or you could do

select cust_name=customer_full_long_name

That works too
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top