Skip to the content.

sql.setIterationVariables

This action executes a sql statement on a relational database and stores the result as iteration variables that can be used by iterations further in the script. The column names in the sql statement will be used as variable name, the query result as variable value. Given that the result will be used to iterate over, every row that is returned is considered as a new iteration. Every column and its value will be stored as an iteration variable part of their iteration scope.

Use cases

Parameters

1: list

list: "reference name for the list"

1: query

query: "any query to execute"

2: connection

connection: "connection where the query needs to be executed on"

Examples

  - number: 1
    type: "sql.setIterationVariables"
    name: "action1"
    description: "run a sql select query and store results as iteration variables"
    component: ""
    condition: ""
    iteration: ""
    errorExpected: "N"
    errorStop: "N"
    parameters:
    - name: "list"
      value : "List1"
    - name: "query"
      value : "select Field1, Field2, Field3 from Table1"
    - name: "connection"
      value : "sql.setIterationVariables.1"