Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Splitting 1 column and inserting into multiple columns

$
0
0
Db2 9.7 FP 7 LUW

Hello,
I have a flat file (.csv) which come from legacy systems non-RDBMS. Some columns have multiple occurrences which needs to be split with integrity in DB2. Here is an example of what i'm trying to do:

ADDRESS
123abc~234bcd~345cde~456def~567efg
111aaa~222bbb~~~
999zzz~~~888yyy~

-There will always be a value before and after a ~ whether it is null or not. If null, it must insert as null in target column, which will be nullable.

Split the 5 occurrences and possibly set them in a variable and insert that variable into it's respective target column.

So essentially I should be able to loop through each record, find values before and after tilde's and insert those into target columns.

Viewing all articles
Browse latest Browse all 13329

Trending Articles