Table transformation / field parsing in PL/SQL

Posted by IMHO on Stack Overflow See other posts from Stack Overflow or by IMHO
Published on 2010-04-30T13:03:45Z Indexed on 2010/04/30 13:07 UTC
Read the original article Hit count: 247

Filed under:
|
|

I have de-normalized table, something like

CODES

ID  | VALUE
10  | A,B,C
11  | A,B
12  | A,B,C,D,E,F
13  | R,T,D,W,W,W,W,W,S,S

The job is to convert is where each token from VALUE will generate new record. Example:

CODES_TRANS

ID  | VALUE_TRANS
10  | A
10  | B
10  | C
11  | A
11  | B

What is the best way to do it in PL/SQL without usage of custom pl/sql packages, ideally with pure SQL?

Obvious solution is to implement it via cursors. Any ideas?

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about plsql