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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Column formatting 1

Status
Not open for further replies.

bmacman

IS-IT--Management
Feb 19, 2001
51
US
I have a quick question. I am trying to format a column in an oracle select statement that is of length 10, but I want the output to be of length 25. In other words, I want 15 blank spaces in the output. I am pretty unfamiliar of the syntax used in Oracle because I am a Teradata User. Any help with this would be greatly appreciated.

Thanks
B
 
Depending on where you want the blanks (leading or trailing) you could use the lpad or rpad functions:

SELECT lpad(my_column,25) FROM ...

will give you enough leading blanks to pad your string out to 25 spaces.

SELECT rpad ....

will do the same thing except for you will now have your data followed by 15 trailing blanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top