Minor formatting problem - not urgent
I've got a cold and can't think straight, so while I'm working on this, I thought I'd post it here as a quick and easy puzzle (hopefully)
I need to output a column, with a leading zero.
Column is PURN NUMBER(10).
I get this:-
select PURN from PERSON
where rownum < 3;
col purn for 0999999999
See, it puts a blank before the zero for some reason. Can this be done without resorting to single row functions ?
You don't see the blank on the forum, try it in sqlplus and you'll see what I mean.
It looks like -
I hope you understand this is purely SQL*Plus isue - what you are trying to achive will work only in SQL*Plus. For any general solution, you would need to use the proper format mask with TO_CHAR function.
Anyway, if you insist on SQL*Plus with COLUMN formating command, then use this:
Your blank is reserved for a minus sign. With the above setting you are instructing SQL*Plus to display sign at the end of the string. Plus sign is not displayed by default, but if you have negative numbers the minus sign will appear at the right side.
col purn for 0999999999MI
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
That did the trick. It was only for a simple report.
Click Here to Expand Forum to Full Width