How to convert form Rows into Columns
Posted: Mon Mar 30, 2009 8:57 am
Hi all,
I am loading an XML file which contains about 10,000 records.
I am using DS 7.5.1A PX jobs on UNIX platform.
These XML files are to be loaded in the SQL Server DB.
After parsing the XML file using DS job got the following output Dataset.
Ex:
Seq_ID, Field_Name, Value
1, Gender, Male
1, Age, 29
1, Nativity, Local
2, Gender, Female
2, Age, 25
2, Nativity, Non-Local
But I need to convert the above data into the following format.
Seq_ID, Gender, Age, Nativity
1, Male, 29, Local
2, Female, 25, Non-Local
Note: I had mentioned only three field names for the header in the above example. may be in future the count of field names could be dynamically change like Gender, Age, Nativity, Religion........, but the output table structure is constant in the DB.
Can anybody please help me out is there any way to resolve the issue.
ThanX,
Vijetha
I am loading an XML file which contains about 10,000 records.
I am using DS 7.5.1A PX jobs on UNIX platform.
These XML files are to be loaded in the SQL Server DB.
After parsing the XML file using DS job got the following output Dataset.
Ex:
Seq_ID, Field_Name, Value
1, Gender, Male
1, Age, 29
1, Nativity, Local
2, Gender, Female
2, Age, 25
2, Nativity, Non-Local
But I need to convert the above data into the following format.
Seq_ID, Gender, Age, Nativity
1, Male, 29, Local
2, Female, 25, Non-Local
Note: I had mentioned only three field names for the header in the above example. may be in future the count of field names could be dynamically change like Gender, Age, Nativity, Religion........, but the output table structure is constant in the DB.
Can anybody please help me out is there any way to resolve the issue.
ThanX,
Vijetha