To convert a string to a number in Oracle you use the
Oracle / PLSQL: TO_NUMBER Function[
^] (Try using your favourite search engine with the phrase "oracle convert string to number")
Your problem, as Maciej has pointed out, is that "1.234.56" is not a valid number in any culture that I am aware of. You would first need to remove that first period, and you can do that with
REGEXP_REPLACE[
^]
If it was meant to be "1,234.56" or "1.234,56" (German) or "1 234.56" (Swedish) then Oracle will still not recognise it as a number unless you do something about Globalisation - see
Globalization Support[
^]
Here is some sample code that demonstrates what might need to be done
with exampleData as (
select '1.234.56' col1 from dual union all
select '1234.56' col1 from dual union all
select '1 234.56' col1 from dual union all
select '1,234.56' col1 from dual
)
select
case when length(col1) - length(replace(col1,'.',null)) > 1
then TO_NUMBER(regexp_replace(col1,'\.','',1,1))
when length(col1) - length(replace(col1,',',null)) > 0
then TO_NUMBER(regexp_replace(col1,'\,','',1,1))
when length(col1) - length(replace(col1,' ',null)) > 0
then TO_NUMBER(regexp_replace(col1,' ','',1,1))
else
TO_NUMBER(col1)
end cnvrted
from exampleData;