cancel
Showing results for 
Search instead for 
Did you mean: 

BODS while loop

Former Member
0 Kudos

Hi

  I am trying to use a while loop to execute a (dataflow to write into a template table)

I have a counter from another template table, say ROW_NO. I have to execute the dataflow in increments of 50 rows until all the ROW_NO are executed.

How can I do that?

Also how can I write to the same template table or append the data without losing the data during the while loop execution?

I am using BODS 14.1.1.210.

Cheers!

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member106536
Active Participant
0 Kudos

using a sql statement in a script, set a global variable to a count of your table.

set another variable =  -1 * ( floor( -1 * <var_count> / 50))

(this will be your max count for your while loop iterator)  while counter <= max count

create a current iter global variable, assign it a starting value of 0.

you'll need a side table to join to your source table, which has a sequence number and some index to join to source.  Counter starts at zero, so you where off counter >= counter * 50 + 1 and var_counter_iter <= (var_counter_iter + 1) * 50

left outer join on sequence table - source table(on index),  then where off on sequence table index is not null.

import your temp table as a perm table.

then after the dataflow, inside the while loop ... increment your var_counter_iter.  ($var_counter_iter = $var_counter_iter + 1;)

If you followed that...

Former Member
0 Kudos

Check this