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!

Return value by pipe (|) delimiter using sql

shuvroApr 21 2020 — edited Apr 21 2020

Hi everyone.

I am using Oracle DB 12c.

I have a master (Lookup) table just like this :

CODE_MASTER

CODE
DESC
ABEFTN
BACC
CCHECK

and in my transaction table, the column(s) will appear like thisĀ  :

TRAN_DTL

TRAN
TRAN_CODE
T001A|B
T002A|B|C
T003B|C
T004A

Note1:TRAN_CODE column is separated by Pipe (|) delimiter

Note2 : I know, this is not a relational db design. But i got the table this way.

Please help me to build a sql using regular expression or db-function, whatever it is. The output should be :

TRANTRAN_CODETRAN_DESC
T001A|BBEFTN|ACC
T002A|B|CBEFTN|ACC|CHECK
T003B|CACC|CHECK
T004ABEFTN

Thanks in advance.

Comments
Post Details
Added on Apr 21 2020
8 comments
4,049 views