How to convert multiple rows of data into single row

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
adams06
Participant
Posts: 92
Joined: Sun Mar 12, 2006 3:00 pm

How to convert multiple rows of data into single row

Post by adams06 »

Hi,


How to convert multiple rows of data into single row?

ex: input

field1

a
b
c
d

output:

a,b,c,d
prabu
Participant
Posts: 146
Joined: Fri Oct 22, 2004 9:12 am

Re: How to convert multiple rows of data into single row

Post by prabu »

adams06 wrote:Hi,


How to convert multiple rows of data into single row?

ex: input

field1

a
b
c
d

output:

a,b,c,d

1)pivot stage
adams06
Participant
Posts: 92
Joined: Sun Mar 12, 2006 3:00 pm

Re: How to convert multiple rows of data into single row

Post by adams06 »

Hi Prabu,

can you explain in detail

Thanks
prabu wrote:
adams06 wrote:Hi,


How to convert multiple rows of data into single row?

ex: input

field1

a
b
c
d

output:

a,b,c,d

1)pivot stage
thumsup9
Charter Member
Charter Member
Posts: 168
Joined: Fri Feb 18, 2005 11:29 am

Post by thumsup9 »

Luciana
Participant
Posts: 60
Joined: Fri Jun 10, 2005 7:22 am
Location: Brasil

Post by Luciana »

The pivot stage reads 1 row with 4 columns and it generates 4 rows with 1 column.

If you you want to read multiple rows (1 column) into single row with the content of the column field1 of all rows, use ROW MERGE stage, but include transforms stage before the row merge stage for connects ";" in the end of the column.

Ex.:
Input --> Transformer --> Row Merge --> Output
a --> a : ";" -->
b --> b : ";" -->
c --> c : ";" -->
d --> d : ";" --> --> a;b;c;d
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi adams06...
You can use "row merger active plug-in stage" and Luciana as explained you in detail..Let us know if you do not have row merger plugin stage......
Post Reply