on 09-17-2014 2:14 PM
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!
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.