- Read a record from a database (select statement)
- Assemble a json string in a variable
- Post the json to a rest web service
- Loop and read the next record from the db
What is the best way to accomplish this?
RickC
Code: Select all
<project name="DB Loop"
mainModule="Main"
version="2.0"
logLevel="verbose">
<module name="Main">
<sql resourceId="MyDBServer"
version="1.0">
<query outputVariable="Data">
<statement>Select F1, F2, F3 from DB.Table</statement>
</query>
</sql>
<forEachLoop label="Loop through Data"
itemsVariable="${Data}"
currentItemVariable="Row">
<setVariable label="setVar: JSON String"
name="JSON"
value="'Set JSON String here'"
version="2.0" />
<https label="Post Raw Data"
resourceId="HTTPS Server"
version="1.0" />
</forEachLoop>
</module>
</project>