How do I specify the maximum size of the result set to display after executing the query in the test run
This example demonstrates how you can fetch the maximum number of rows to be returned when a query is executed.
In the solution shown below, you set the maximum number of rows to be returned using the "dbSetMaxResultSetCount" command and the query is executed using the "dbExecuteQuery" command in the HICC application.
Solution:
# | Command | Target | Value |
---|---|---|---|
Start of a dbCONNECT Block | |||
1 | dbBlockOpen | age | |
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 set the maximum number of records to be fetched | |||
4 | dbSetMaxResultSetCount | 1000 |
|
To execute the DB Query | |||
5 | dbExecuteQuery | GetZipcodes |
zipcodes |
End of a dbCONNECT Block | |||
6 | 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 db query, the timeout specified is in seconds.
- The number of records is the number of rows.
- If the command "dbSetMaxResultSetCount" is not explicitly used within a dbBlock, a default value will be used as to limit the data if huge data is returned.