Float Numeric data truncated at the 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
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Float Numeric data truncated at the SQL Server

Post by joycerecacho »

Hello guys.

I have a problem.
The job is reading a DataSet that contains a Char field but with numeric content.

Example of its content: +0000000000000004574759004.0820020000000000000000000

It has 52 positions.

This number need to be inserted in a field Float( 8 ) of an SQL Server Database.
When we import the table definition through Orchestrate, the field comes as Double (without length) and we used it like this.

The thing is, I used the function StringToDecimal(<field>) before insert the value and when I check the table the value is like: 4574759004.082.
In other words, the decimal part of the number is truncated.

I've already tried lots of alternatives and they didn't work.
I am not sure whether it's about a limitation of DataStage, an SQL Server limitation or none of them.
The SQL Server is the 2008 version.

Best Regards my friends, thank you so much.
Joyce A. Recacho
São Paulo/SP
Brazil
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Each of these is the same number. Float numbers are stored in binary format - there is no need for redundant leading or trailing zeroes. When displayed, " " is used as the sign character for positive values.

The only way to re-generate the zeroes is to convert to a string.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post by joycerecacho »

Guys, I found the problem.
There is a limitation when it is used data type Float(8) - because its limit is only 15 positions.
It is an SQL Server limitation.

Thank guys!!!!!!!!!
Joyce A. Recacho
São Paulo/SP
Brazil
Post Reply