Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In a database column, there are many values that are actually an array of values. Each item in the array needs to be written out to a separate row in the target, a database in this case.
Example:
The source looks like: A\n-B\n-C\n-
Which is actually an array: [A, B, C]
This needs to be written out into 3 rows
A
B
C
Getting the source into an array may be handled using a JavaRow using:
String temp = input_row.housing_types.trim();
String types[] = temp.split("\n- ");
ArrayList<String> housingTypesList = new ArrayList<String>();
The problem I can't seem to figure out is how to get the values into separate rows. It might be possible write the array out to a temp file and then read it back in as if it was a delimited file, but that is rather kulgy.
Is there a way to write each element of the array into a separate row?
Many thanks in advance.