With one in the table I try to insert the n-th number of records in another. In the first table there is a field with the type varchar2 and in the second it is number in the first table there is data with a floating point and when their type is sweared because the number cannot be set floating point number

substr(str, 1, instr(str,'.')-1) ROUND(str) TRUNC(str) 

they did not help the first if an integer in the field skips it and instead puts null

  • the number format in varchar2 is what, there the separator is always exactly the point. And do you have a separator for numbers in the session the same point? And the number is simple or like the number (13,2) and most importantly what result you want to get, exactly the whole part. And did you try to explicitly cast the type round (TO_NUMBER (str))? - Mike

1 answer 1

This is how it should work.

 nvl(substr(str, 1, instr(str,'.')-1),str)