Number conversion

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

reddy
Premium Member
Premium Member
Posts: 168
Joined: Tue Dec 07, 2004 12:54 pm

Post by reddy »

thankx craig,

The data did load perfectly but i want the data to be in te following format

I want the data to be converted into the following format:

Target

3001.23
200.20
2345.00
2323.00
1876.12

where as the data which is loaded does not have zeros and also that i need 2 digits compulsorily after the decimal.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Those zeroes are not significant. You have no control over how the data in a NUMBER field is stored internally in Oracle. You are arguing about an external representation, which is strictly an artifact of how you select the data.

Try this:

Code: Select all

select to_char(YourField,'99999999.99') from YourTable
With enough nines to cover the size of your field or your largest value. Look more better?
-craig

"You can never have too many knives" -- Logan Nine Fingers
reddy
Premium Member
Premium Member
Posts: 168
Joined: Tue Dec 07, 2004 12:54 pm

Post by reddy »

Yes you are right, the loading of data does not depend on us. I changed the datatype to char and this time it worked.

Thank you for your patience,time and effort.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It worked all the other times, too. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply