Page 1 of 1

Float Numeric data truncated at the SQL Server

Posted: Wed Aug 22, 2012 7:49 am
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.

Posted: Wed Aug 22, 2012 4:40 pm
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.

Posted: Wed Aug 22, 2012 5:32 pm
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!!!!!!!!!