Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: How to suppress the leading space of a number column?

Re: How to suppress the leading space of a number column?

From: Sam Nelson <sam_at_ssrl.org.uk>
Date: 17 Apr 2001 16:05:50 GMT
Message-ID: <9bhpku$sqk$12@wallace.stir.ac.uk>

In article <uqqodtcam2ivdpvc6cqmbd8cth1g5jl6lu_at_4ax.com>,  Sybrand Bakker <postbus_at_sybrandb.demon.nl> writes:
> As in my previous reply: use to_char(number expression,'fm<mask>')
> where fm is shorthand for fill mode.
> The space is the sign bit, it will be - for negative numbers.
> Of course this is documented behavior, and I really must urge you to
> read them.

It's very-poorly-documented behaviour. In my Oracle 7 SQL Ref (the last version I have on paper) the fill-mode modifier is described six pages away from the number-format list, with examples in variable-width font, which isn't much help. If you happen to know that it's `fill-mode' you're looking for (which you may well not) then you can find

  Fill mode
    trims trailing blanks 3-57

in the index which doesn't help much for trimming leading blanks. This feature when I was looking for it took me two years to find with occasional input from onsite Oracle programmers and two (relevant) Oracle employees I know, all of whom tended to use `LTRIM(TO_CHAR(...))' as a kludge, which is what I did in the interim. Not that I spent _all_ that time looking, you understand, but when I did find it, everyone I informed of it was pretty gobsmacked to realise that it was in the manual all the time.

-- 
SAm.                                 (Insert bandwidth-wasting disclaimer here)
Received on Tue Apr 17 2001 - 11:05:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US