Split field values using specific character

oracle

Please help me with this.

It is possible to split field values using a specific character?
Here is my sample table

value
10uF
2K
1.0uF
200UF

I want it to split by this:

value       capacitance/resistance
 10            uF
 2             K
 1.0           uF
 200           UF

PS: I am using Oracle and the numbers should be separated from letters

Best Answer

Using regular expressions is an option:

create table capacity (inputdata varchar2(30));

insert into capacity(inputdata) values('10uF');
insert into capacity(inputdata) values('2K');
insert into capacity(inputdata) values('1.0uF');
insert into capacity(inputdata) values('200UF');

commit;

select regexp_substr(inputdata,'^[0123456789.]*') value,
regexp_replace(inputdata,'^[0123456789.]*','') unit
from capacity
;

here is this example on sqlfiddle Maybe you should improve the regular expression pattern of the number format

Regular expression functions are described here in the manual and on the following pages