# Run Command

## Settings&#x20;

![](https://1031980850-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRKcZBCSfHjT8BRPnSe%2F-MWur7Etu_oTwkzWSyM4%2F-MWurSmJvxQ5z8QeN1g2%2Fimage.png?alt=media\&token=e5339ce1-9654-48fb-9b5c-c1fd88df8f3a)

| Field                  | Description                                |
| ---------------------- | ------------------------------------------ |
| Title                  | Object title                               |
| Object Identifier Name | Window Automation Unique Name (variable)   |
| Select the main Object | Represents the settings of the database    |
| Alter/Selection        | Define the action to be taken              |
| Command                | Command that should be run on the database |

## Example

&#x20;In order to run commands in a database, some steps must be taken:&#x20;

1 - Select the database configuration object. In this example we will use Sql Server.

* First of all drag into the working area the object **SQL Server**;
* Next, add the Run Command object and set the Sql Server configured earlier as the configuration object;
* Set the type of operation to be performed. In this case the object separates in two ways of execution.&#x20;
  * Execution of Insert, Alter or Delete script (other commands can also be executed);
  * Execution of script for data loading (SELECT).
* Enter the command and click on "Confirm".

{% hint style="info" %}
**Important: How to loop through the returned data when the command type is "Select"?**

Every data selection command will return a LIST with the columns that were requested. In order to loop through the data, it will be necessary to include the object "**Loop Through List**" in the working area, which can be found in the "**Loops**" menu.
{% endhint %}

### Workin  Area&#x20;

The working area for this example should be like:&#x20;

![r](https://1031980850-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRKcZBCSfHjT8BRPnSe%2F-MWur7Etu_oTwkzWSyM4%2F-MWutqipYhkRGs1N5KmD%2Fimage.png?alt=media\&token=a3d33b82-6c6e-4bf7-a818-31112f0853a3)

{% hint style="info" %}
The "**LOG Message**" object included within the "**Loop Through List**" exemplifies how information can be accessed. In this case, we access the "Description" column of the "TbClient" table.&#x20;
{% endhint %}
