Bind links are used to execute a target action for each row of a source SELECT statement.

Image1

If the target action is a scripting action, then you can get the current bind iteration number with the following code:

__ctx__.getCurrentBindIteration()

 

If it is not a scripting action (for example a SQL Operation), you need to use the previous code within a bind-scripting context:

%b(rhino){__ctx__.getCurrentBindIteration();}b%

 

Example in an INSERT statement:

INSERT INTO mytable (C1, C2)
VALUES (%b(rhino){__ctx__.getCurrentBindIteration();}b%, :{COL2}:)