1. Home
  2. ExecuteNonQuery

ExecuteNonQuery

◷ Reading Time: 2 minutes

Summary

Database commands such as Insert, Delete and Update can be performed using this rule command.

Parameters

  1. command
    1. Description: The TSQL command
    2. Mandatory: Yes
    3. Type: String
  2. return
    1. Description: Name of the variable in which the row will be stored
    2. Mandatory: Yes
    3. Type: String
  3. storedProcedure
    1. Description: Determines whether the command should execute a stored procedure in the database
    2. Mandatory: False
    3. Type: Boolean (true/false)

Internal Commands

Param

Sample

<While condition="index lt 2">
  <Var name="index" value="index+1"/>
  <ExecuteNonQuery command="INSERT INTO person ([fname],[lname]) VALUES (@name, @family)" return="count">
    <Param name="name" value='"name"+(index.ToString())'/>
    <Param name="family" value='"family"+(index.ToString())'/>
  </ExecuteNonQuery>  
</While>

Adding Bulk values

When you want to update the table with a list of values, you can use the bulk option.

For example, in the below command, values are defined as a variable in the project.

value list =
[
    {
        "Id" : 1,
        "AssetStatus" : "queued"
    },

    {
        "Id" : 2,
        "AssetStatus" : "queued"
    },

    {
        "Id" : 3,
        "AssetStatus" : "queued"
    }
]

Under Bulk, we can reference this value list.

Updated on January 22, 2020

Was this article helpful?