Page 1 of 1

Reading Data from Dataset

Posted: Thu May 12, 2005 10:08 am
by varshanswamy
Hi,

I have data of ten digits say for example 3024410009, I have given the Data Type to be BigInt and the Precision to be 32. I am reading this data in a dataset but it reads it as a negative number. Could you please tell me which data type and whioch precision would be the best for such kind of data.

regards,
varsha

Posted: Thu May 12, 2005 4:31 pm
by T42
When you are dealing with integers, you can give it any precision numbers you want, but...

Datastage will ignore the precision number when it handles Integers.

If you MUST have a specific length for numbers, either use Varchar, or Decimal.

Integers are exactly the same as C's Integers.

P.S. Integers can hold data up around 10 digits long (For 32-bit DataStage.)

Posted: Thu May 12, 2005 4:43 pm
by bcarlson
You can use integer, but you must use an unsigned integer.

A signed integer can hold values from -2 ^ 31 through +(2^31) - 1, or -2147483648 to +2147483647 (approx -2.1 billion to +2.1 billion)

An unsigned integer can hold from 0 to +(2^32) - 1 = +4294967295 (0 to approx. +4.3 billion)

If you know the minimum and maximum values of your input field are within these ranges, then you can use integer. Otherwise, like T42 says, you'll need to hold it in a varchar/char or decimal field.

Posted: Thu May 12, 2005 5:01 pm
by T42
You can use a BigInt if you want. My talk of the decimal field is specifically for those 'fixed length' fields that some clients (especially those with mainframe-produced data) like to see and use.