# Database Query

This action can be used to run queries on a database and extract desired data.

## Properties<br>

![](https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2FycUvkWZU2Bu05rp03aPY%2Fimage.png?alt=media\&token=ecb1d190-8e56-4ef8-98c9-e230fde1ec30)

### ‌Input

![](https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2FnxJhFpLmjJCNeeuS4Nlv%2Fimage.png?alt=media\&token=a835d61f-b4ad-48e0-8756-123fdf4394b7)

* **Query:** The query which will be executed on the given tatabase connection.
* **Database Connection:** The DatabaseConnection object which will be used to interract with the SQL Server.

### Output

![](https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2FpRxfwvv4PZPStEJhYty9%2Fimage.png?alt=media\&token=9dcefc96-1950-4401-8c3d-fbaf2309763e)

* **Result:** The resulting DataTable object returned by the query.

{% hint style="info" %}
**Note:** This object **must** have the **Variable Type** set to **DataTable**.
{% endhint %}

### Misc

![](https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2Fy9YNZqn7qdETi8uFcw1k%2Fimage.png?alt=media\&token=b39fc8a8-1e88-4cdf-8df6-327fc2658ad4)

* **Display Name**: action display name in your implementation project.
* **Wait Before**: number milliseconds robot to wait before executing the action.
* **Wait After:** number milliseconds robot to wait until moving to the next action.
* **Abort on Error**: True/False.
* **Retry Times**: Specifies the number of times to retry an action if it doesn't end successfully. Default value 0 (no retry); Use -1 if you want to retry indefinitely.

## **Use Case**

### **Potential Use Cases** <a href="#potential-use-cases" id="potential-use-cases"></a>

* Run querries on a database to extract customers based on the specified requirements and insert them in a CRM.

{% embed url="<https://youtu.be/9lylvB7daaU>" %}
