Problem while Reading Float DataType from DataBase

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
Mandy23
Participant
Posts: 8
Joined: Wed Nov 09, 2011 4:04 pm
Location: USA

Problem while Reading Float DataType from DataBase

Post by Mandy23 »

Hi ,

I am trying to read a column BMIPercentile defined as FLOAT in SQL Server Database using ODBC Connector Stage. I have specified column definition as Type=Float , Length=53 , Scale=10.

My Job is aborting with below Fatal error .

Schema reconciliation detected a size mismatch for column BMIPercentile. When reading database column DFLOAT into column SFLOAT, truncation, loss of precision or data corruption can occur


Let me know what should be the correct Column definition to be defined ?
Mandy
samdsx
Premium Member
Premium Member
Posts: 19
Joined: Wed Aug 18, 2010 8:48 pm

Re: Problem while Reading Float DataType from DataBase

Post by samdsx »

If you will not get really large numbers, cast to decimal data type in query.
Mandy23
Participant
Posts: 8
Joined: Wed Nov 09, 2011 4:04 pm
Location: USA

Post by Mandy23 »

Hi Sam,

My case is I have to read data form table and update the same table again. I do not want to lose data by conversion errors.
Mandy
samdsx
Premium Member
Premium Member
Posts: 19
Joined: Wed Aug 18, 2010 8:48 pm

Post by samdsx »

It should work fine with decimal, please try and let us know the results
iq_etl
Premium Member
Premium Member
Posts: 105
Joined: Tue Feb 08, 2011 9:26 am

Post by iq_etl »

I have the same issue. I'm reading a source table with a column defined as a FLOAT in SQL Server Database using ODBC Connector Stage. Exact same definition as post in the OP.

What is meant by 'cast to decimal type in query'. Is this writing an SQL query and doing a conversion on the column from a FLOAT to a DECIMAL? Would FLOAT be left as the column type in the column tab?

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

Post by chulett »

iq_etl wrote:What is meant by 'cast to decimal type in query'.
CAST function. As to your last question - no, it would be whatever data type you are casting to.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Specify Double as the data type the DataStage table definition. Some databases, including Sybase and SQL Server, report Float for DFloat data types.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

Once this specific issue is fixed, please do compare the precision values between source and target.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

I second SURA on this. I have seen the value in scale getting changed from SQL server and Oracle, but it was fine till 12-13 digits (Can't remember exactly). But, It was from SQL server 2000 to Oracle 10g.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
iq_etl
Premium Member
Premium Member
Posts: 105
Joined: Tue Feb 08, 2011 9:26 am

Post by iq_etl »

ray.wurlod wrote:Specify Double as the data type the DataStage table definition. Some databases, including Sybase and SQL Server, report Float for DFloat data types.
This worked. I previously understood that Double was reserved for very long numbers. Is using Double a best practice here due to the nature of SQL Server database or should I go with CAST?

Thanks!
Post Reply