convert bigint 64bit into int 32bit

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kavuri
Premium Member
Premium Member
Posts: 161
Joined: Mon Apr 16, 2007 2:56 pm

convert bigint 64bit into int 32bit

Post by kavuri »

Hi,
I need to convert a bigint (64bit) into int (32bit). I dont want to lose any data and I cant strip data. I need to maintain the data ina single column again. But I dont have those many records which needs not more than 32 bit int. So one thing I am assuming is making a reference table and then use mapping logic. If you can give me any alternate way please let me know.

Thanks
Kavuri
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: convert bigint 64bit into int 32bit

Post by chulett »

kavuri wrote:I need to convert a bigint (64bit) into int (32bit). I dont want to lose any data and I cant strip data.
Then you are out of luck when the value in your bigint exceeds what can be stored in the int. What then? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kavuri
Premium Member
Premium Member
Posts: 161
Joined: Mon Apr 16, 2007 2:56 pm

Re: convert bigint 64bit into int 32bit

Post by kavuri »

Hi Craig,
Here I dont need exact data as it is in the source column. I can convert it and then pass the values to another package which is already built. After I get the result from the package I need to do reverse mapping to get the original values.
So here I would like to create a correspondancies table. Can I do it?

Thanks
Bhargava
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry, but I have no idea what you just said. There's no "conversion" in this kind of operation. :?

And if you don't need "exact data as it is in the source" why state "I don't want to lose any data and can't strip data"?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kavuri
Premium Member
Premium Member
Posts: 161
Joined: Mon Apr 16, 2007 2:56 pm

Post by kavuri »

Sorry Craig,
here I mean is I have to reconstruct original data back at the end.

Thanks
Bhargava
Post Reply