Validating Column Data Stored as CSV Against Another Table

Posted by Jakkwylde on Stack Overflow See other posts from Stack Overflow or by Jakkwylde
Published on 2010-03-08T14:33:12Z Indexed on 2010/03/08 14:36 UTC
Read the original article Hit count: 250

Filed under:
|

I wanted to see what some suggested approaches would be to validate a field that is stored as a CSV against a table containing appropriate values. Althought it would be desired, it is NOT an option to split the CSV list into another related table. In the example data below I would be trying to capture the code 99 for widget A.

Below is an example data representation.

Table: Widgets

WidgetName   WidgetCodeList
A            1, 2, 3
B            1
C            2, 3
D            99

Table: WidgetCodes

WidgetCode  
1
2
3

An earlier approach was to query the CSV column as rows using various string manipulations and CONNECT_BY_LEVEL however the performance was not acceptible.

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about oracle10g