Issue with Float data type and sql server

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
hobocamp
Premium Member
Premium Member
Posts: 98
Joined: Thu Aug 31, 2006 10:04 am

Issue with Float data type and sql server

Post by hobocamp »

I have a simple job in which my source is a sequential file, and the target is a sql database table. A number of fields are of the Float data type. I've got the data defined as Float in both the source and target, and am doing a straight move within the transformer. Data length for both source and target is 53.

But what I've found is that by the time the data is displayed in sql, there are suddenly extra digits to the far right of the decimal. For example, the source flat file contained a value of .00277778, but in sql the value is suddenly 277777994051576. So it's like the opposite of rounding!

I should add, if I output the same date to a flat file target, it displays correctly, without the extra digits. Has anyone else run into this before? I've tried combinations of the DFLoatToDecimal and DFloatToStringNoExp, but still get the same results. (I've also opened an SR with IBM to see what they say.)

Thanks for any advice!
Tom
hobocamp
Premium Member
Premium Member
Posts: 98
Joined: Thu Aug 31, 2006 10:04 am

Post by hobocamp »

Did a little more research here in the forums. I found something somewhat similar to the issue I was facing, and the recommendation there was to set the datatypes (within the job) to Double (instead of Float) for both the source and target. Once I tried that, the data then displayed correctly in sql.

Hopefully this will help someone else facing this problem. I will mark this Resolved.
Post Reply