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!

Design Question: Handling comma separated ID's to values

1550201Jun 2 2015 — edited Jun 2 2015

All,

We have a table called Product which has many columns but the tricky one is multilist, basically its comma separated list. Following is the table structure

IDNumberDescriptionMultilist_01
123A12341Test Description,98778,98779,98780,98781,98782,
124A12342Running Product,98782.98781,98780,
125A12343Obsolete Product,98782.98781,98780,98783.98784,98785,
123A12344Production Part

The columns "Multilist_01" is storing all the Id's where the data is stored in a separate table(lookup table called "lists") which has the following table structure

EntryIdEntryValueEnabled
98778RTXYes
98779NTXYes
98780MTXYes
98781OTXYes
98782QTXYes
98783PTXYes
98784STXYes
98785BTXYes
98786ATXYes
98787CTXYes
98788XTXYes

Problem: How would i convert multilist_01 values to actual vlaues?

This is how the end output should look like:

IDNumberDescriptionMultilist_01
123A12341Test DescriptionRTX,NTX,MTX,OTX,QTX
124A12342Running ProductQTX.OTX,MTX
125A12343Obsolete ProductQTX.OTX,MTX,PTX,STX,BTX
123A12344Production Part

Two things happened

1. ID's are converted to Values

2. leading and trailing comma's are removed

Interesting thing which can happen

1. if Lists.Enabled = "No" then even if Multilist_01 field has the ID but it shouldn't be converted

2. Multilist_01 is a character length of 200, if its overflows its stored in a different table

Currently the table had 5 million items with 50 multilists (mulitilist_01 - multilist_50) so I would like to know which approach i need to consider in developing this?

Thanks in advance

Nash

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 1 2015
Added on Jun 2 2015
8 comments
776 views