Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table name as "record" having one column as "column_val" and their are 3 rows and the data is like
column_val
-------------
a
b
c
I have 3 context variables names as "varA","varB" and "varC".
Now, i want to load the first row value to varA, second row value to varB and 3rd row value to varC.
Can someone Help on this?
One way of doing it would be to use tDenormalize on your input data. This would transform your input data from row to columns. In tDenormalize you could specify anything as your delimiter. Once that is done take the output from tDenormalize and use it inside tJavaRow and use a bit of String functions to split the string into multiple parts - in your three parts and assign them to three different context variables.
//Code generated according to input schema and output schema System.out.println("After denormalize: "+input_row.column_val); String[] parts = (input_row.column_val).split(","); context.new1 = parts[0]; context.new2 = parts[1]; context.new3 = parts[2]; System.out.println("After split-context1: "+context.new1); System.out.println("After split-context2: "+context.new2); System.out.println("After split-context3: "+context.new3);