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!

Column Width

Status
Not open for further replies.

unisysguru

Programmer
May 16, 2001
10
US
I am new to RDMS.

I have a Select where the Column is wider than the data.

SELECT data1, data2 FROM jobq;

I get:

data1 data2
------------------- -------------------
item1 item2
item1a item2a

would like to shorten width to be:

data1 data2
------- -------
item1 item2
item1a item2a

How do I do this?

Bill
 
Bill,

There are a couple a methods in the Oracle world to shorten strings:

1) Using Oracle SQL alone:
SELECT substr(data1,1,7) alias1
, substr(data2,1,7) alias2 FROM jobq;

2) Using Oracle SQL*Plus combined with SQL:
col data1 format a7
col data2 format a7
SELECT data1, data2 FROM jobq;

Is this is what you wanted?

Dave
Sandy, Utah, USA @ 19:02 GMT, 12:02 Mountain Time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top