Source is a sequential file, reading COL1 and COL2 as Double Precision. Target is an Oracle table. Output is not what is expected.
SOURCE:
COL1,COL2
-10240547.950000,219892.738536
current output:
COL1,COL2
-10240547.949999999,219892.73853599999
expected output:
COL1,COL2
-10240547.950000,219892.738536
In DataStage both COL1 AND COL2 are defined as Double.
In target Oracle table both columns are defined as Float(126). I do not have any control over target format table data type or length.
[Note: Topic / Title edited for clarity - Andy]
Unexpected output from Double Precision
Moderators: chulett, rschirm, roy
Not really sure how. Welcome to the Wonderful World of Floating Point... it seems that someone made a less than ideal choice as to the target data type, unless there is some reason why it needs to be a float? They always complicate things.
Oracle even recommends you do not use FLOAT as a data type but rather their BINARY_FLOAT or BINARY_DOUBLE types as they are 'more robust'. And just as an FYI, 126 digits of binary precision is roughly equivalent to 38 digits of decimal precision. Scroll up a little bit up from here to begin their discussion of the data type.
Perhaps try to CAST the string to FLOAT in your target SQL? Or the double but I'd probably just read the fields from the file as plain old strings.
![Sad :(](./images/smilies/icon_sad.gif)
Oracle even recommends you do not use FLOAT as a data type but rather their BINARY_FLOAT or BINARY_DOUBLE types as they are 'more robust'. And just as an FYI, 126 digits of binary precision is roughly equivalent to 38 digits of decimal precision. Scroll up a little bit up from here to begin their discussion of the data type.
Perhaps try to CAST the string to FLOAT in your target SQL? Or the double but I'd probably just read the fields from the file as plain old strings.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers