Page 1 of 1

Using columns as rows

Posted: Thu May 31, 2001 8:42 pm
by admin
Using Datastage, how would you go about looping through a set of columns as if they were rows?

For instance, given a text file, with the following fields: OrderNumber Item1Code Item1Qty Item2Code Item2Qty Item3Code Item3Qty etc...

I want to insert a new row into an orders table for each new OrderNumber (for each row in the text file) and insert a new row into an items table for each ItemCode that is not null.

Any help is appreciated,

Anthony

Posted: Fri Jun 01, 2001 12:51 am
by admin
There are at least four different ways to do this kind of normalization using DataStage. Probably the easiest is to perform a horizontal pivot on your data using the Pivot stage.