TPump error - 2683 Numeric overflow occurred during computation.
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


TPump error - 2683 Numeric overflow occurred... Expand / Collapse
Author
Message
Posted 6/26/2009 5:33:19 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 10/27/2009 8:14:22 AM
Posts: 13, Visits: 53
Hi,

I am using a Java program to write dat ( binary ) file to be loaded by TPump script.

For "Decimal" column type, here is how I write the data:

aValue = ((BigDecimal) aValue).movePointRight(((BigDecimal) aValue).scale());

aValue = ((BigDecimal) aValue).toBigInteger();



byte[] integerBytes = aValue.toByteArray();

int paddingLength = len - integerBytes.length;

// integerBytes always in big endian (see BigInteger.toByteArray())

if (!BIG_ENDIAN)

{

for (int i=(integerBytes.length - 1); i >= 0; i--)

{

dataBuf[dataOff++] = integerBytes[i];

}

}

else

{

System.arraycopy(integerBytes, 0, dataBuf, dataOff, integerBytes.length);

dataOff += integerBytes.length;

}

... do the padding and write buffer to file

Now the problem is For a column type Decimal(8,2) I am getting 2683 error - but only when I run on AIX, with TPump failing to insert afert first few records and ERROR table shows 2683 error, whereas on windows it works fine.

Forgot to add that this is due to difference in ByteOrder ( windows is LittleEndian and AIX is BigEndian)

How can I modify above to work consistently, w.o affecting other data types.



Thanks.
Post #15933
Posted 7/2/2009 3:53:38 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 10/27/2009 8:14:22 AM
Posts: 13, Visits: 53
ok..i got it fixed.. for others' reference, the above code has a bug..
for a column defined Decimal(8,2) - tpump expects 4 bytes of number.

when I use some value that can fit in 2 bytes , BigInteger("1024").toIntegerBytes will return only two bytes (e.g. 1024 = 04 00 in big endian), :
This code generates 4 byte representation by padding additional 00 or FF as:
00 04 "00 00" ( little endian) [RIGHT for 1024]
04 00 "00 00" (big endian) [WRONG for 1024]
(the bytes in quotes are padded to make it 4 byte)
in case of little endian it is ok to pad the bytes to right, in case of big, it should have been on the left.. and correct form would be:
00 00 04 00.
Post #15996
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 1:37am

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.031. 7 queries. Compression Disabled.