Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to format a column from code.
Chuck wrote:
> With sqlplus I can do "COL mycol FORMAT 999,999,999" to format long
> numbers with commas.
>
> How can I do this from within code? Do I need to just select the column
> and then use logic in the code to reformat the numbers?
>
> Thx,
> CC
>
Chuck,
your question lacks vital informations: what is the client you're planning to run this code from? If it's interactive SQL*Plus, then the answers in this thread are correct. However, since you specifically talk about code, I hope you realize that to_char will actually take a number and turn it into a different datatype. If it's for display use only, you're probably fine. But if you're planing to use that number any further, sooner or later you're going to end up in a mess.
Holger Received on Thu Aug 25 2005 - 02:11:41 CDT
![]() |
![]() |