Page 1 of 1

Converting BigInt(Int64) to Integer(Int32) in Modify Stage

Posted: Wed Jan 23, 2008 4:41 am
by prashanthgovindaraj
Can i have the syntax/example for Converting BigInt(Int64) to Integer(Int32) in Modify Stage.

Posted: Wed Jan 23, 2008 8:19 am
by ray.wurlod

Code: Select all

OutputColumn:int32=InputColumn 
or

Code: Select all

OutputColumn:nullable int32=InputColumn
Input column is of data type int64. This will generate "possible loss of precision" warning. You can create an additional specification containing just the single token NOWARN to suppress the warnings: this is probably not a good idea - what if one of the int64 values is larger than 2147483647 (the largest possible int32) or smaller than -2147483648 (the smallest possible int32)?

Posted: Wed Jan 23, 2008 11:44 am
by prashanthgovindaraj
ray.wurlod wrote:

Code: Select all

OutputColumn:int32=InputColumn 
or

Code: Select all

OutputColumn:nullable int32=InputColumn
Input column is of data type int64. This will generate "possible loss of precision" war ...

I get a warning when i tried to implement the idea. The warning needs to be avoided. What needs to be done here??

Posted: Wed Jan 23, 2008 7:37 pm
by ray.wurlod
Read the remainder of my post, which deals with suppressing the warning.

Premium membership costs less than 30c (Rs12) per day. These funds are totally devoted to assisting with the hosting and bandwidth costs incurred by DSXchange. It is a worthwhile investment.

Posted: Thu Jan 24, 2008 9:31 am
by krishnakumar_m16
Give the specification in the modify stage as given above and change the Integer Datatype to BigInt Datatype in the column metadata definition.