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
Concatenation of multiple columns to a single column
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 13
- Joined: Thu Dec 02, 2010 2:55 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 13
- Joined: Thu Dec 02, 2010 2:55 am
-
- Participant
- Posts: 32
- Joined: Tue Dec 13, 2011 7:27 am
Re: Concatenation of multiple columns to a single column
As Craig suggested use Char datatype and make sure your $APT_STRING_PADCHAR is set to space(0x20).