Iterating a value until condition is reached.

DECLARE @Company varchar

/* While Loop for each company in the SalesCompanies (Denmark/United States) (see above) */
WHILE SalesCompanies.EOF=false

/* Set up the variable company */
SET @Company=SalesCompanies.TablePrefix

/* Read the data from the SQL server connection from the table substituting part of the tablename - SQL becomes e.g. SELECT from Denmark_Sales */
IMPORT factSalesData=sqldb.{SELECT * FROM @@COMPANY_Sales}MOVENEXT SalesCompanies / Move cursor to the next Company
LOOP /* Iterate the loop */