Strange issue while converting varchar to integer

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Strange issue while converting varchar to integer

Post by prasson_ibm »

Hi,

My source and target is Oracle and one column STYLECOLOR is in source is VARCHAR and same column in Target is Integer and data will be interger only.

When source data is long integer value like "99991013751235" then in target its converted as "2147483647".
I am not applying any conversion function.Can someone help me to fix this issue.
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

You exceeded the Integer's bounds. 2,147,483,647 is the biggest number it can handle. Use big integer (BigInt) which supports up to 9,223,372,036,854,775,807.
Last edited by asorrell on Thu Aug 08, 2013 1:21 pm, edited 1 time in total.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Target Oracle column is defined as NUMBER(16) and i think this value will fit into this datatype.
What conversion function i need to apply in transformer to convert varchar into Number(16)
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Is the target defined as Number(16) or Integer? You've stated both :|

It's not the conversion that's the problem, it's the datatype the value is being placed into. Make sure your datatype out of the transformer can hold the value. As Andy stated, an Integer cannot hold a value that large. Either a BigInt or a Decimal of appropriate size (16) would be acceptable datatypes.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

That is why I used to mark similar columns as BigInt in datastage when mapping to the ODWH. :lol:
N.Srinivas
India.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Yes but some of them are left unmarked and hence identified as issue.It resolved now.... :lol:
Post Reply