Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

split records..

Status
Not open for further replies.

INFEXP

Programmer
Jul 1, 2003
8
GB
Hi,

I have a strange request...

I need to split a row into multiple rows..

for ex..

if there is row with max 8 columns i.e.

101 102 103 104 105 106 107 108 8

With 8 indicating the depth (This above could be of depth or level 1 or 2 or 3...8), i need this to be loaded into a target table as follows


ROW1 --> 101 1

ROW2 --> 101 102 2

ROW3 --> 101 102 103 3

ROW4 --> 101 102 103 104 4

ROW5 --> 101 102 103 104 105 5

ROW6 --> 101 102 103 104 105 106 6

ROW7 --> 101 102 103 104 105 106 107 7

ROW8 --> 101 102 103 104 105 106 107 108 8

where 1,2,3,4,5,6,7,8 indicating depth or levels.

The way i have thought is to have Router which will split recods based on levels and have an expression for each levels which will then pass
it to instance of the target table, the only problem being there will be for 8,7,6,5,4,3,2,1 levels 36 instances of target which is quite wierd. Is there a better logic...

Thanks
 
Hi,

I think i have found the solution whereby u can use 8 targets instead of 36 targets.
The steps which I propose is in line with what u have done so far.

1. In the ROUTER use 8 different conditions, like,
grp1: TRUE
grp2: level > 1
grp3: level > 2
.
grp8: level > 7
2. Then associate each group with the corresponding expression transformation..
grp1 with exp1 having col1 and assign level = 1
grp2 with exp2 having col1, col2 and assign level = 2
grp3 with exp3 having col1, col2, col3 and assign level = 3
...
Ultimately records will be inserted in correct order.

Hope this helps,
Niloy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top