|
Loop Dataset Action |
Declaration |
<AMLOOPDATASET DATASET="text"
FROM="number" TO="number"> |
See Also |
Loop, End Loop, Loop Files, Loop Windows, Loop Processes, Loop Expression, Loop List, Break |
Loops through the rows of the dataset specified. With each successive loop a block of steps is executed and the current row of the dataset is incremented. The loop ends when at the end of the dataset or when a Break is encountered.
To loop a block of steps through the records (rows) in a dataset (which is a multicolumn, multirow variable). With each loop the current record (row) in the dataset is incremented, until the last record is reached at which point the loop is ended.
Specifies the name of a previously created dataset. Example actions that create datasets are SQL Query, POP3 Mail, and Stored Procedure.
Specifies the record (row) to start on when moving through the dataset.
Specifies the record (row) to stop on when moving through the dataset. If omitted or set to 0 the End Row is the last in the dataset.
Standard Error Handling Options
This action also includes the standard "Error Causes" and "On
Error" failure handling options/tabs
More on Error Handling Options
Variables and Expressions
All text fields allow the use of expressions by surrounding the expression
in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help
construct these expressions, a popup expression builder is available in
all these fields by pressing F2.
More on variables...
More on expressions...
More on the expression builder...
<!-- The following task executes a SQL query which populates
a dataset called CUSTOMERLIST It then loops through that dataset and writes
the values to a file record by record --->
<AMSQLQUERY CONNECTIONSTRING="Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=username;Initial Catalog=testdata;Data Source=SERVER"
DATASETRESULT="CUSTOMERLIST" SQLSTATEMENT="SELECT FIRSTNAME,
LASTNAME FROM CUSTOMERS WHERE CITY='LOS ANGELES';">
<AMLOOPDATASET DATASET="CUSTOMERLIST">
<AMFILEWRITE FILE="c:\customerlist.txt" WRITEDATA="!!CUSTOMERLIST.FIRSTNAME!!
!!CUSTOMERLIST.LASTNAME!!">
</AMLOOP>