Skip to content

dbExecuteQuery (dbCONNECT)

Compatible with:
  • Purpose
  • This command is the main query that is responsible for getting the SQL query, identified by a label, executed by the appropriate dbCONNECT Tunnel operating on one of your company's servers.
  • Worksoft SaaS does NOT execute SQL query from/on its cloud but sends the query to the appropriate dbCONNECT on your end along with the database alias name that corresponds to a real database behind your AUT.

    When dbCONNECT Tunnel receives this query execution request from Worksoft SaaS, in the context of a test being executed within your domain, dbCONNECT reads from db.json (that drives your dbCONNECT tunnel) the connection string to connect to the database that the 'dbAlias' in your test refers to, and get the SQL query executed.

    Since it may take some time for the dbCONNECT and/or your database to execute the SQL query, Worksoft SaaS waits asynchronously for the query result to be sent back from dbCONNECT.
  • When the SQL query execution completes, dbCONNECT sends the result set back to Worksoft SaaS, and the test that is executing in Worksoft SaaS, that was waiting for the query execution results, proceeds with the test execution.
  • If the response does NOT go back to Worksoft SaaS within the maximum time allowed for a query (as specified explicitly by the use of dbSetTimeOut command or implicitly applied with a default value if that command is not used), the test that in Worksoft SaaS that was waiting for the results of the SQL query, will automatically abort the test.
  • If the result set returned by dbCONNECT has more rows than stipulated by the MaxResultSetSize (as specified explicitly by the user of dbSetMaxResultset command or implicitly applied with a default value if that command is not used), Worksoft SaaS will truncate the results to the top N rows from the returned result set.
  • Syntax
  • dbExecuteQuery(query,datasetName)
  • Target
  • Query or Label assigned to the SQL Query (using the dbLabelQuery command)
  • Value
  • Name of the Dataset within which the SQL Query response result set (returned by dbCONNECT Tunnel) gets stored into.
  • The Dataset must have been declared earlier within the test in progress (not necessarily within the current dbBlock wherein the dbExecuteQuery command is used) using the command ddCreateDataSet.
  • You must make sure that the result set has the same number columns as the number of attributes in the data definition that you used to declare the Dataset.
  • Return Value
  • N/A

Example(s):

Click here to see the example 


 

Feedback and Knowledge Base