sql - how to insert string to given string in oracle? -
i having 1 string test1string
need pad 3 zeros before every digit.the result string should test0001string
.i have tried pad,regexp_instr didn't right result.can explain methanks in advance
you can utilize regexp_replace
:
sql> select regexp_replace('test1string', '([[:digit:]])', '000\1') tx dual; tx -------------- test0001string
sql oracle oracle11g
No comments:
Post a Comment