Page 1 of 1

Decimal values Getting rounded

Posted: Mon Jul 03, 2006 2:23 pm
by aceflyer
Hi
In my source table i have a column "quantity" which has data type "real" having length as 7 . say for example one value is 12.76378682376 , when i load it directly into the database table its getting loaded fine . but i have to follow a few steps before so i am loading it into a dataset and then in the next step into the database
the problem in this is when i am loading it into a dataset the value is getting rounded to 3 decimal places eg:12.764 for the above input value
i have played with different data types to get the full value but couldnt

Please advice over this

Thanks

Posted: Mon Jul 03, 2006 2:32 pm
by us1aslam1us
Hav u defined the precision scale in the dataset?

Sam

Posted: Mon Jul 03, 2006 2:55 pm
by aceflyer
Yes i have tried all the possible data types with precision , without precision

Posted: Mon Jul 03, 2006 3:17 pm
by us1aslam1us
Could you just tell us what length and precision have you defined in the dataset. you mentioned length as 7 in your initial post and i think thats y you are getting this.

Thanks
Sam

Posted: Mon Jul 03, 2006 3:18 pm
by ray.wurlod
Is it really rounding into the Data Set, or is it merely that the data browser (View Data) that is doing the rounding? If you move the data from the Data Set into a table or text file, are the data complete?

Posted: Mon Jul 03, 2006 3:21 pm
by aceflyer
Hi Ray
Its not just the view data , but i am loading the data in the dataset into the target table , the target data for that clolumn in being rounded to 3 decimal places

Thanks

Posted: Mon Jul 03, 2006 3:39 pm
by ray.wurlod
Can you post the record schema for the Data Set?

Posted: Mon Jul 03, 2006 3:50 pm
by aceflyer
record
( Part_ID: string[max=255];
Cust_ID: string[max=50];
Cust_ASM: string[max=50];
Cust_GSM: string[max=50];
UNIT: sfloat;
REVENUE: sfloat;
UNIT_EXP: sfloat;
CREATE_DATE: timestamp;
CURRENT_FLAG: string[max=1];
T_Date: timestamp;
)


The source column Quantity is getting divided into 3 columns Unit,Revenue,Unit_Exp

Posted: Mon Jul 03, 2006 11:38 pm
by kumar_s
What is the datatype in target? Is it the view data which gives you the truncation or the target or the both?

how did u resolved?

Posted: Mon Apr 21, 2008 8:18 am
by scorpion
Hi aceflyer,

Have u got the solution for this,if u remeber just tell me how did u achieve this?since i am having same issue..

Posted: Mon Apr 21, 2008 4:48 pm
by savis
Can you try this way?

Multiply the field by 10000 (say x) or some other value and try to store in some datatype.

when you reterive, divide the field by the same number (x) .

I do agree that this will have negative impact on your performance?

If you find any other better solution, do post it..

Thanks,
Savis