Hi, I know this question has been answered to an extent previously, but some one could provide the answer.
I've the following string:
str = ' 000241137|00148-940-06237-001|C|Supply|10,427.20| '
The above string has to be divided into 4 different columns:
I am trying to use REGEXP_SUBSTR.
SELECT REGEXP_SUBSTR ('000241137|00148-940-06237-001|C|Supply|10,427.20|', '[^|]*', 1,2 ) AS part_1 from dual; --RES: NULL
SELECT REGEXP_SUBSTR ('000241137|00148-940-06237-001|C|Supply|10,427.20|', '[^|]*', 1,3 ) AS part_1 from dual; -- RES: 00148-940-06237-001
Occurring similarly from next element also ( Null,res,null,res).
I also tried using :
SELECT RTRIM (REGEXP_SUBSTR ('000241137|00148-940-06237-001|C|Supply|10,427.20|', '[^|]*', 1,2 ), '|') AS part_1 from dual;
the result is same.
Could some one help me with this.
--Much Appreciated.
Thanks.