Skip to main content

Execute SQL statements

Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

Execute SQL commands like INSERT, UPDATE, DELETE, and more on a connected database. This action allows you to perform SQL operations directly from your RPA workflow.


Parameter Values

Input parameters

Parameter

Description

Required

Options / Notes

Database

Select a database connection

Yes

Must be a previously configured database connection

SQL statement

Enter the SQL statement to be executed

Yes

Supports standard SQL syntax for operations like INSERT, UPDATE, DELETE

Timeout (s)

Set the maximum execution time for the SQL statement in seconds

Yes

Default is 30 seconds; use higher values for complex queries

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action doesn't produce any variables.


Using Variables in Conditions

You can use variables in the SQL statement parameter by inserting them with the {x} syntax. This allows you to dynamically construct SQL queries based on data from previous steps in your workflow. When using variables in SQL statements, ensure that proper data type handling is maintained to prevent SQL injection vulnerabilities.


Notes

  • Before executing SQL statements, ensure that the database connection is properly configured and accessible.

  • For data manipulation statements (INSERT, UPDATE, DELETE), be careful with the WHERE clause to avoid unintended modifications to your database.

  • Consider implementing appropriate error handling for database operations, especially for production workflows.

  • Complex queries may require longer timeout values to complete successfully.

  • SQL syntax must be compatible with the target database system you're connecting to.

Did this answer your question?