Skip to Main Content
  • Questions
  • Inserting a decimal which has no decimal into the table with a decimal point

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, srinivasan.

Asked: July 22, 2016 - 6:05 pm UTC

Last updated: July 24, 2016 - 9:01 pm UTC

Version: 10g

Viewed 1000+ times

You Asked

Hi Tom,
I want to insert a decimal number which has no decimal point into a table with a decimal point. Is there a predefined function or a way to do this?

Ex: (46926831654) should be inserted as (469268.31654)

I dont want to use the string concatenation with decimal since I suspect it will reduce my code efficiency.

Thanks

and Connor said...

There is defined facility to do this.

If it is always 5 decimal points, then perhaps just insert :value/100000, or insert the entire number and have a virtual column to calculate the correct value.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Simple solution helps a lot

srinivasan chittibabu, July 22, 2016 - 7:58 pm UTC

Thanks for your answer. Its a simple solution but worth. BTW its a fixed length which will come through a flat file. I am gonna use your solution in sql loader control file.

Thanks a lot!!!
Connor McDonald
July 24, 2016 - 9:01 pm UTC

Glad we could help