Skip to content

How do I execute the SQL query in the test run

This example demonstrates how you can execute an SQL query in the test run.

In the solution shown below, the dbCONNECT tunnel and database names are provided using the "dbSetContext" command and the label name is given to the query using the "dbLabelQuery" command. It is executed using the "dbExecuteQuery" command in the HICC application

Solution:

# Command Target Value
Start of a dbCONNECT Block
1 dbBlockOpen

To specify to Worksoft SaaS the "database" and "dbCONNECT tunnel" names
2 dbSetContext Worksoft SaaStrainingTunnel
eureqa_postgres_ipc
To set the label name to the query
3 dbLabelQuery select zip.zipCode from eureqaref.Ref_US_Zipcode zip join eureqaref.Ref_US_State stat on stat.stateCode = zip.stateCode where lower(stat.stateName) = lower('California')
GetZipcodes
To execute the DB Query
4 dbExecuteQuery GetZipcodes
zipcodes
End of a dbCONNECT Block
5 dbBlockOpen dbBlockEnd

Tips, Tricks, Gotchas & Best Practices:  

  • It is recommended to give a label name to the query using the "dbLabelQuery" command
  • It is a best practice to set the timeout before you execute a database query
  • The timeout specified is in seconds


Feedback and Knowledge Base