Page 1 of 1

data type convertion in modify stage

Posted: Thu Sep 30, 2004 12:28 am
by lakshmipriya
hi
I want to convert a column from the datatype decimal(10,0) to integer without any warnings using a modify stage.

I tired to use the function "int32_from_decimal" but its returing rows with warning.

When checking operator: When binding output schema variable "APT_TRoutput0Rec0": When binding output interface field "NUMBER" to field "NUMBER": Conversion; from source type "decimal[10,0]" to result type "int32": Possible range limitation




How can i do this, give me some suggestions

Posted: Thu Sep 30, 2004 2:56 am
by mandyli
Hi lakshmipriya ,


Please check datatype in the previous modify stage.


Thanks
Man

Re: data type convertion in modify stage

Posted: Thu Sep 30, 2004 4:57 pm
by kura
Try with int64_from_decimal, and declare you out data type as bigint instead of integer.

Vijay

Posted: Fri Oct 01, 2004 12:40 pm
by waitnsee
If you are converting from decimal(10,0) to integer, its more like integer to integer, thats why its giving you a binding error.
Decimal (10,0) is nothing but a 10 digit integer with no decimal spaces. So, you can declare the field itself as integer of 10.
Let me know if that works !!!

Posted: Fri Oct 01, 2004 3:42 pm
by kura
Eventhough it is binding error, if read till the end of sentence, you will range limitation error. Because in the PX I orbserved that if have input 10 digit integer data type will not accept. You have declare as Bigint.

Posted: Fri Oct 01, 2004 4:21 pm
by ray.wurlod
Not every ten digit number is an integer.
The largest (four byte (32 bit)) signed twos-complement integer is 2147483647; the largest unsigned is 4294967295.

Posted: Sat Oct 02, 2004 8:44 am
by kura
[quote="ray.wurlod"]Not every ten digit number is an integer.
The largest (four byte (32 bit)) signed twos-complement integer is 2147483647; the largest unsigned is 4294967295.[/quote]

yes you are right. If there is data coming wiht 3123456789, then obviously int32 will not accept.

vijay

Posted: Wed Oct 06, 2004 2:26 am
by lakshmipriya
Hi

Thanks for your suggestions, now its work fine.
I changed the input length from 10 to 9 so that it converts decimal(9,0) to integer

Thank U