Transfering data from VARCHAR field to a NUMBER field

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

Post Reply
yaminids
Premium Member
Premium Member
Posts: 387
Joined: Mon Oct 18, 2004 1:04 pm

Transfering data from VARCHAR field to a NUMBER field

Post by yaminids »

Hello friends,

I am getting the following error when I tried to transfer data from a VARCHAR field to NUMBER field
"ORA-01722: invalid number"

Is it possibe to convert the data (similar to to_number() function)
using a particular function in DataStage?

Any help would be highly appreciated
Yamini
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

I guess you can use NumericIsSigned transform.
Kris

Where's the "Any" key?-Homer Simpson
yaminids
Premium Member
Premium Member
Posts: 387
Joined: Mon Oct 18, 2004 1:04 pm

Post by yaminids »

Hi Kris,

I got the same error (ORA-01722: invalid number) even after using NumericIsSigned function
This is how I used the function in the Transformer
NumericIsSigned(inLink.EMPR_ID)

Did I use the function incorrectly?
Can someone please help me with this?

Thanks
Yamini
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You actually don't need to do anything special to 'convert' a Varchar to a Numeric field in Server, it all happens automatically. There is an assumption, however, that what data is in the Varchar field is appropriate for a numeric field. Your error indicates that it isn't, meaning there are characters there that Oracle doesn't consider appropriate for a NUMBER field. Silly things like letters, perhaps.

Have you looked to see what is actually in the problem field? That will tell you what you need to do to solve the problem. It may be as simple as using the DIGITS transform, but without knowing what is causing the issue that would just be a guess.
-craig

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