Hi All,
I have a problem when dealing with bigint values. In my job in a transformer when itry to assign eighteen 9's i.e 999999999999999999 to a BigInt(19) field it rounds the value to 2808348671. How can i pass the original value to output as i could not find any explicit type conversion function. Code isl ike
if length(field)>18 Then 999999999999999999 else field value
so when it reaches the first branch only then there is a problem
BigInt Problem
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 25
- Joined: Fri Jan 11, 2008 12:49 am
- Location: Pune, India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The largest permissible BigInt (int64) value is 9,223,372,036,854,775,807 (2^63-1) in a twos-complement machine. This has 19 digits.
Therefore nineteen "9" characters is not a legal BigInt.
You need to re-think your logic.
Does this "rounding" happen only in View Data, or are you writing the result out to a file or a Peek event? If it is happening only in View Data then the data browser may be treating BigInt as Int.
Therefore nineteen "9" characters is not a legal BigInt.
You need to re-think your logic.
Does this "rounding" happen only in View Data, or are you writing the result out to a file or a Peek event? If it is happening only in View Data then the data browser may be treating BigInt as Int.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
[quote="ray.wurlod"]That value only has eighteen "9" characters and is therefore legal as a BigInt. ...[/quote]
Yeah thats write but if you pass it directly in a BigInt field it is rounded to int32 value by datastage. To retain this value,it need to be passed
1) as a character field
2) using the function StringToDecimal while passing to a BigInt value
Yeah thats write but if you pass it directly in a BigInt field it is rounded to int32 value by datastage. To retain this value,it need to be passed
1) as a character field
2) using the function StringToDecimal while passing to a BigInt value