Home » RDBMS Server » Server Administration » How to insert a comma in VARCHAR2 field
How to insert a comma in VARCHAR2 field [message #375165] Thu, 02 August 2001 00:32 Go to next message
Amit Jain
Messages: 33
Registered: August 2001
Member
I am having an amount column in a table which is of VARCHAR2 type.Now I am inserting a record in it through a JAVA file i.e query generates at runtime.Now I want that value in the above mentioned column should be entered as 16,480.92 instead of 16480.92.When i tried to insert with this format it is taking it as two different values (16 and 480.92).Anybody pls can help on this regard.This is very urgent.
Re: How to insert a comma in VARCHAR2 field [message #375167 is a reply to message #375165] Thu, 02 August 2001 01:15 Go to previous message
Norvin
Messages: 22
Registered: July 2001
Junior Member
hi,

try to use to_char function
TO_CHAR(number, 'fmt')
as per your problem

SELECT TO_CHAR( 16480.92, '99,999.99' ) FROM DUAL;

you may opt to reformat the fmt to:
'$999,999,999,999.99'

i hope this may help.
Previous Topic: Oracle---Tables
Next Topic: Re: COMPLEX SQL QUERY - HELP REQUIRED
Goto Forum:
  


Current Time: Tue Dec 24 06:32:29 CST 2024