Execute Non-Query

This activity is used to Insert, Delete, or update details to and from an existing table.
The import data and the execute non-query activity performs the same functions.
The difference is, the import data can be used to input data into a table without
adding any condition. The execute non- query activity is used to do the same activity,
with a specific condition.

Technical Reference

 

 

INPUT

DBName: Specify the name of the database in which the table is present.

Location: Specify the location of the database in which the table to be edited is present.

Query: Specify the query which has to be used to insert, delete or update the table.

 

 

 

 

MISC

Display Name: Displays the name of the activity. You can also customize the activity name to help troubleshoot issues faster. This name will be used for logging purposes.

SkipOnError: It specifies whether to continue executing the workflow even if it throws an error. This supports only Boolean value “True or False”

True: Continues to execute the workflow irrespective of any error thrown.

False: Stops the workflow if it throws any error

Version: It specifies the version of the Portable database feature in use.

OUTPUT

Result: Define a Boolean value to validate the success state of the activity.

*Mandatory fields to execute the workflow

Use Case

The following activity illustrates on how we can use the execute non query activity
to insert the name of a company,contact and country to an existing table company
contact.

Steps to execute a bot

1. Drag and drop an execute non query activity to the workflow.

2. Double click on the activity and enter the database location and name.

3.  Specify the query to be used. Here it is “INSERT INTO CompanyContact
(Company, Contact, Country) VALUES ('WrightBrothers','JohnSamuel',
'UnitedKingdom');"

4.  Drag and drop an execute query activity below this activity.

5. Double click on the activity and enter the database location and name.

6.  Specify the query for which you would like to view the details.

7. Here it is “Select * from CompanyContact”

8.  Declare a variable here to see the output in a table. Here it is “dt”

9.  Now connect a table viewer activity to the workflow.

10.   Enter the above declared variable.

11.  Run the activity in debug mode to see the details inserted into the table. The table
viewer activity runs only in debug mode.

The bot executes the activity, inserts the details into the table, executes
the given query and displays the details in the table.