landolakes
IS-IT--Management
I'm stuck trying to figure out how to easily take a specific delimited field of values, and populate another similar table that has the values broken out (see below). This forum was very helpful when I had to process data in the other direction, but I have not been able to figure out the reverse of that.
Almost thought I had it looking at thread186-1291312, but not quite. I do have access to create procedures which is how I figured this may be accomplished.
Here is the TMP_DENORM (source) table:
NBR NAME CERTS
1001 joe TI BA OC
1002 bob TI BK
1003 jim TI LV
Here is what the TMP_NORM (destination) table needs to look like:
NBR NAME CERTS
1001 joe TI
1001 joe BA
1001 joe OC
1002 bob TI
1002 bob BK
1003 jim TI
1003 jim LV
Almost thought I had it looking at thread186-1291312, but not quite. I do have access to create procedures which is how I figured this may be accomplished.
Here is the TMP_DENORM (source) table:
NBR NAME CERTS
1001 joe TI BA OC
1002 bob TI BK
1003 jim TI LV
Here is what the TMP_NORM (destination) table needs to look like:
NBR NAME CERTS
1001 joe TI
1001 joe BA
1001 joe OC
1002 bob TI
1002 bob BK
1003 jim TI
1003 jim LV
Code:
CREATE TABLE TMP_NORM
( NBR INTEGER,
NAME VARCHAR2(20 BYTE),
CERTS VARCHAR2(100 BYTE) );
CREATE TABLE TMP_DENORM
( NBR INTEGER,
NAME VARCHAR2(20 BYTE),
CERTS VARCHAR2(100 BYTE),
PRIMARY KEY
(NBR) );
INSERT INTO TMP_DENORM ( NBR, NAME, CERTS ) VALUES (
1001, 'joe', 'TI BA OC');
INSERT INTO TMP_DENORM ( NBR, NAME, CERTS ) VALUES (
1002, 'bob', 'TI BK');
INSERT INTO TMP_DENORM ( NBR, NAME, CERTS ) VALUES (
1003, 'jim', 'TI LV');
commit;