Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Split string with key value pair

3890361Feb 15 2019 — edited Feb 15 2019

Hi,

I have a string held in a column as below:

'product~P1$department~D1$company~C1'

I need to split this string into individual values as below:

P1

D1

C1

product, department and company are static parts of the string but can occur at any position within string ie.

'product~P1$department~D1$company~C1'

OR

'department~D1$product~P1$$company~C1'

OR

'company~C1$product~P1$department~D1'

etc...

I know INSTR and SUBSTR can do the job.

However need advise if more optimized and performance way to achieve it.

This post has been answered by Manik on Feb 15 2019
Jump to Answer
Comments
Post Details
Added on Feb 15 2019
3 comments
929 views