On Mon, Oct 28, 2002 at 10:13:02AM -0500, Johnson, Shaunn wrote:
> Yes, you cannot cast a numeric to character, but there is a function called
> to_char() that will help.
>
> Something like:
>
> planning=# select to_char(4, '0000009');
> to_char
> ----------
> 0000004
>
> The only annoying thing is that it seems to put a blank in front of the
> string, I am not sure why. You will probably want to trim() the results.
test=# select to_char(4, '99999999');
to_char
-----------
4
test=# select to_char(4, 'FM99999999');
to_char
---------
4
See docs, it's better then trim() :-)
Karel
--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz