Hi,
we have the requirement of splitting the value of a column and generate columns dynamically based on the delimiter present in the value.
For example:
I have a columns reference_columns in table T1.
The column will have the value as COL1||COL2:COL3||COL4
the delimiter here is : . so we want to generate two columns dynamically usgin sql query or transformer(preferable select query).
The columns generated through select query should be like
Ref1 Ref2
COL1||COL2 COL3||COL4
anyone please help me in this
thanks
need logic in splitting the record and generate columns
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 80
- Joined: Fri Aug 21, 2009 7:49 am
- Location: India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What's the source database? Display functions differ between databases.
In a Transformer stage in DataStage it's easy - just use Field() functions specifying ":" as the delimiter character.
In a Transformer stage in DataStage it's easy - just use Field() functions specifying ":" as the delimiter character.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.