The SQL Statement Advanced action executes SQL statements. It enables you to perform administrative tasks like cleaning a database after a test. It also allows you to get business-related metrics that you can monitor, for example the number of items in a work queue or the number of checkouts during the last minute.
The action produces an XML output that includes a status of the executed SQL statement as well as an optional section containing the results of the query. The query results are also stored in Neotys Design Studio variables.
Information: In case of connection with Microsoft SQL Server 2005, you need to replace the Microsoft SQL Server 4.1 JDBC Driver with the Microsoft SQL Server 4.0 JDBC Driver by following this
procedure.

Parameters
QUERY and UPDATE.Variables
When executing a query, be careful to specify the variable name, i.e "" and not "sqlEntries".${sqlEntries}
columnName" is the column name as defined in the database. Invalid XML characters are removed, for example count(*) would be renamed to count.The query result values will be retrieved in the following variables:
Examples
An example of removing all lines of a table:
UPDATEmyConnectionDELETE FROM table_nameAn example of getting number of rows:
QUERYmyConnectionSELECT count(*) FROM table_namecountTableNameIn this example, since the query will return one row of one column, only the variable will be created.countTableName
An example of SELECT with a custom driver:
QUERYmyConnectionSELECT * FROM records WHERE date='2014-11-11'recordscom.ibm.db2.jcc.DB2DriverIn this example, the following multi-valued variables will be created : and records_id gives access to the id of the first row, records_date records_id_1 and records_id_count give access to the number of rows, records_id_matchNr gives access to the date of a random row.records_date_rand
The SQL Connection Advanced action creates a database connection.

Parameters
jdbc:mysql://localhost:3306/).Examples
An example of creating a connection to a MySQL database:
jdbc:mysql://host:3306/mysqlmy_user_namemy_passwordAn example of creating a connection to a DB2 database:
jdbc:db2://host:50000/dbmy_user_namemy_passwordcom.ibm.db2.jcc.DB2DriverThe SQL Disconnection Advanced action closes a previously opened database connection.

Parameters
Example
An example of closing the connection "myConnection".
myConnection