PROCESIO
OverviewPlatform ActionsIntegrations & DemosCustom ActionsDeveloperโ€™s Guide

Execute command

Use this action to execute a SQL command in Microsoft SQL.&x20;

Query vs Commands: There's a basic difference between them - commands modify the data, and queries retrieve the data.

Use this action to execute a SQL command in Microsoft SQL.

First of all, you'll have to enter credentials for the Execute Command action. You can find out how to do that here.

How to configure the Execute Command action?

Go to the Process Designers section and open a new or an existing process. Actions configuration can be performed once they are dragged and dropped on canvas.

Step 1:ย Drag the Execute Command action from Toolbar and drop it on canvas; click on the action to open the Properties Panel.

Step 2:ย You can edit the Action Name.

Step 3: Select a credential for the database server (see here how to create one)

Step 4: Click on Execute Command (not configured) card to go to the configurations steps.

Step 5: Type your SQL query in the editor.

Note: you can always add process variables to your query. Press INSERT/Ctrl+I (Windows) or Cmd+I (Mac).

Step 6: Add the output variable. Note: it has to be defined as a single-value object/integer.

In the output variable, you will see the number of rows affected by the executed command.

Add the output variable:

Step 7: Save, Validate and Run the process.

Step 8: Click Check Instance to view the results.

Based on our command, 2 rows were affected:

Note

Using SQL Parameters

When writing SQL commands in Execute Command, you can use SQL parameters to safely send values from your process to the database.

Instead of inserting variables directly in the SQL command, define parameters and map them to values in the configuration panel (as shown in the screenshots above).

For example, instead of writing:

INSERT INTO Clients (FirstName, Email)VALUES ('{{client.firstName}}', '{{client.email}}')

You can use parameters:

INSERT INTO Clients (FirstName, Email)VALUES (@firstName, @email)

Then map the parameters in the action configuration:

ParameterSQL TypeValue
firstNameNVarChar{{client.firstName}}
emailNVarChar{{client.email}}

Using parameters helps you:

  • avoid SQL syntax errors caused by special characters like '
  • reduce the risk of SQL injection
  • simplify SQL commands that use process variables
  • make workflows easier to maintain

If a parameter value is null, PROCESIO automatically sends a SQL NULL value to the database.

On this page