Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> sql*Plus formatting question
Platform: Oracle EE 10.2 on HPUX
Given this snippet of code:
set pages 999
set lines 512
set trimspool on
--
spo plus.log
--
select name "Name",
owe||to_number(grade) "Grade", from ...
where owe is varchar2(1)
grade is varchar2(3)
and grade is actually a 2-digit number, all of which are in the range '01' to '09'
When I run the query, the length of the 'Grade' column comes out to 41 characters, left justified. I've tried bracketing the results ('['|| owe||to_number(grade)||']') to see if I'm getting a bunch of leading or trailing spaces, but that has shown that the data returned is exactly the expected two characters. Have tried enclosing the to_number inside a to_char (since I'm concatenating the results to a varchar), but to no effect. If I don't concatenate owe and grade (selecting them as two separate columns) there is no problem. Received on Tue Jun 05 2007 - 10:27:41 CDT
![]() |
![]() |