Running a query

Overview

The run query instruction allows a user to run a query on a Access database Table. The instruction can be configured to check whether the number of rows it modifies satisfies a particular condition.

For the purposes of this article we are going to use a simple and fictitious Access database. You will want to replace this file with one of your own.

Before we get started

Please further create a ‘Manipulate a file’ or ‘Multiple file manipulations’ action step so that you can add and use instructions.

The Access database Table contains the following data:

Steps

1. Create a ‘Run query’ instruction.

2. Open the Expert SQL Editor by clicking the ‘View/Edit SQL’ hyperlink.

3. In the Expert SQL Editor, you can write the query you want to run, as well as specify the Table you want to run the query on. Here, we will write a query which clears all the data from the Table1. Type “DELETE FROM [Table1]” into the Editor.

4. Save the query.

5. Enable the ‘Check the numbers of rows modified to determine if this step was successful’ rule by ticking its box.

6. The first part of the ‘This step is successful if the number of modified rows’ condition is set to ‘Is exactly’ by default. Other options include ‘Is more than’ and ‘Is less than’.

7. Type “3” into the field for the second part of the ‘This step is successful if the number of modified rows’ condition. Alternatively, adjust the ticker next to this field to “3”.

8. Save and run the step.

9. If the step runs successfully, it means that exactly 3 rows were modified in the Table. As we saw earlier, there were only 3 rows in the Table. Therefore, a query which clears the Table must modify exactly 3 rows. After the step finishes running, open the Access database Table. You will see that the Table has no rows remaining:

Leave a Reply

Latest Tweets

Free eBook: 10 Tips for sourcing good data yucalc.com/2017/02/17/fre…

reply · retweet · favorite

Newsletter

By signing up, you agree to our Terms of Service and Privacy Policy.

Address

Suite 1506, Westfield Tower 2, 101 Grafton St Bondi Junction NSW 2022 Australia

View Larger Map

Contact Us

AUS: +61-2-9386-0202
UK: +44-20-8123-1251
Send us an email

ContactUs.com
WordPress Image Lightbox