Issu With Decimal Datatype

Database
Enthusiast

Issu With Decimal Datatype

Hi All,

In my table there is decimal datatype defined as like this decima(30,15). I am getting source data more than defined size like below

0.299999999999999988897769753748434595763683319091796875 . I need to turncate it and load into table. Any sugggestions ?

Thanks in Advance

5 REPLIES
Enthusiast

Re: Issu With Decimal Datatype

I notice a space '8 75' in your value.

Is this the problem you need to correct?

If the space wasn't there the value would insert and round off.

Rglass

Enthusiast

Re: Issu With Decimal Datatype

Hi Glass,
There is no space in that value.I am unable to round off the value also.am getting error like big value

Enthusiast

Re: Issu With Decimal Datatype

Have you tried Casting function in your query?

Junior Contributor

Re: Issu With Decimal Datatype

The cast fails due to too many digits in your input string. 

TO_NUMBER('0.299999999999999988897769753748434595763683319091796875')

doesn't fail in cases like that.

Enthusiast

Re: Issu With Decimal Datatype

Thank you Dieter,

It's Working. :)

-Anil