Number conversion
Moderators: chulett, rschirm, roy
Number conversion
Hi Guyz,
I have a requirement as follows:
I have the source data in the following format:
Source
3001.23
200.2
2345
2323
1876.12
I want the data to be converted into the following format:
Target
3001.23
200.20
2345.00
2323.00
1876.12
Could someone help me with this issue. Thanks in advance.
I have a requirement as follows:
I have the source data in the following format:
Source
3001.23
200.2
2345
2323
1876.12
I want the data to be converted into the following format:
Target
3001.23
200.20
2345.00
2323.00
1876.12
Could someone help me with this issue. Thanks in advance.
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
Mike,
I really appreciate your response but as i mentioned i already have decimal point in it and decimal point is also a character and hence it is not allowing me to do so and is giving me warnings. So by using FMT function we can only insert decimals when there are no decimals but my case is different. I have a mixture of all kinds of numbers.
please let me know if you have any other options.
I really appreciate your response but as i mentioned i already have decimal point in it and decimal point is also a character and hence it is not allowing me to do so and is giving me warnings. So by using FMT function we can only insert decimals when there are no decimals but my case is different. I have a mixture of all kinds of numbers.
please let me know if you have any other options.
Suggest you let us know what your target is. If we're talking sequential file, then in spite of what you wrote the FMT function *is* the answer. For a database or anywhere else where those zeroes are not significant, don't even worry about doing this.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Sure, but there's no point for a NUMBER field. They aren't significant and Oracle doesn't need them. If you want to see them when you select the data back from Oracle, use an appropriate TO_CHAR() mask but worrying about that during your load is a complete waste of time.
Or is this going into a VARCHAR2 field?![Confused :?](./images/smilies/icon_confused.gif)
Or is this going into a VARCHAR2 field?
![Confused :?](./images/smilies/icon_confused.gif)
Last edited by chulett on Thu Oct 16, 2008 2:10 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Again - what issue? Did the data not load or otherwise generate an error? Or does it just not look the way you'd like it to when you select it back from the database? If the latter, that's just an issue with your select, not the load. That's the difference I'm trying to see if you understand.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers