Concatenation of multiple columns to a single column
Posted: Fri May 03, 2013 5:05 am
Hi all,
I have 5 columns with varchar datatype in the oracle database .
I need to read those 5 columns and need to generate 3 columns.
The example how to generate 3 columns is mentioned below
example :
Input:
C1,C2,C3,C4,C5 are there columns in the database.
Output:
C1 , C2 , C3C4C5
Third column is nothing but concatenation of C3,C4 and C5 columns.
My concerns during concatenation i should keep the length of the field also in mind.Incase if the value of the coulmn is less than maximum length then i need to pad spaces in the right.
Padding the spaces can be done in the transformer.Any easy way to pad spaces to the unused bytes.
Table 1: datatype is varchar2(3)
C1 C2 C3 C4 C5
1 2 3 4 5
Output:
F1 F2 F3
1 2 3 4 5 (ie.,after 3 two spacea and the same way for 4 and 5 also)
Thanks,
Thripura
I have 5 columns with varchar datatype in the oracle database .
I need to read those 5 columns and need to generate 3 columns.
The example how to generate 3 columns is mentioned below
example :
Input:
C1,C2,C3,C4,C5 are there columns in the database.
Output:
C1 , C2 , C3C4C5
Third column is nothing but concatenation of C3,C4 and C5 columns.
My concerns during concatenation i should keep the length of the field also in mind.Incase if the value of the coulmn is less than maximum length then i need to pad spaces in the right.
Padding the spaces can be done in the transformer.Any easy way to pad spaces to the unused bytes.
Table 1: datatype is varchar2(3)
C1 C2 C3 C4 C5
1 2 3 4 5
Output:
F1 F2 F3
1 2 3 4 5 (ie.,after 3 two spacea and the same way for 4 and 5 also)
Thanks,
Thripura