execute sql


Execute an SQL command against the database currently in use.



Applicable Built-In Settings

The following settings are applicable to this action: remove double quotes from cell, standard ASCII only.

Applicable Controls

This action is applicable to the following controls: none.

Example - Case 1: Running an SQL command to get a single result

The following example retrieves the CName field from the CTable table of the CustDB database for a CID of 102 , then checks the returned value against the expected value, Roberto Dylando.

Action Lines


Example - Case 2: Running an SQL command to get multiple results

In this example, the execute sql action is used to execute a stored procedure, rather than a direct SQL query. The stored procedure then executes two SQL queries, returning two result tables, each of which is capture to a data set. The contents of the data sets are then written out to two text files.

The stored procedure looks like this:

Action Lines


The resulting text files appear as follows:



Related concepts

Testing with databases

Copyright © 2023 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1(800) 322-0333