I've got code for extracting numbers from varchar2 column:
with t1 as (
select 1 as acode, '100,00' as avalue from dual union all
select 2 as acode, '100.00' as avalue from dual union all
select 3 as acode, '100.00%' as avalue from dual union all
select 4 as acode, '100.00perc' as avalue from dual
)
select acode, nvl(abs(regexp_replace(replace(avalue,',','.'),'[^1,2,3,4,5,6,7,8,9,0,.,]')),0) as avalue
from t1
After few weeks of using we received complain, the Customer said that "sometimes" the procedure works too long. He said, it always works about two minutes, but "sometimes" it can work more than 24 hours! He investigated the issue and decided that the problem is regexp_replace (it's too heavy).
Could you please:
1) explain to me is it true that regexp_replace is too heavy
2) give me solution how do I receive the same result without regexp_replace.
Actually, I'm not trying to prove that regexp_replace is normal. It's a pity, but I can't discuss the issue with the Customer. I'm just trying to understand details for myself.