Service Studio 6.0 Help
Test Query
To test the logic of your simple and advanced queries without needing
to repeatedly
1-Click
Publish or
Run
your eSpace, Service Studio provides you with a test
and preview query feature for both the simple and the advanced
query editors.

The query testing area, which is the lower section of both the editors' windows (see picture above) is organized into the following tabs:
Test Inputs: Area where the query parameters' test values are edited. These values are used when the button Test is pressed and the query is sent to the server.
Test Output: Area where the query testing results are presented.
SQL:
In the Simple Query Editor, it is a non-editable text area that displays the SQL generated for the test.
In the Advanced Query Editor, it is an editable text area. Actually, it is the area where the query is defined.
Since the same SQL
syntax rules are used in both editors, you can copy the tested SQL
of a simple query to an advanced query and end up with exactly the same
query!
Operations in the query testing area
The testing tab section of both the Simple and Advanced Query Editors allows you to execute the following operations:
Edit Parameters' test values: Write a literal in a parameter test value by editing it in the Test Inputs tab.
Edit Test Max. Records (only available in the simple query editor): Write an integer to change the maximum number of result rows to be retrieved by the test, by editing it in the Test Inputs tab.
Note that the query test output is always
limited to the Returned
Rows Limit defined in the Service Studio options.
Select tenant (only available for multi-tenant eSpaces): This is a drop-down, with all current tenants, allowing you to specify in which tenant context the query will be executed. The selected tenant is memorized and synchronized with the tenant drop-down of the TrueChangeTM tab, in the Lower pane.
Test query: When you press the Test button, the following happens in your eSpace:
The query definition and all the expressions used by it are verified. If any error is found, a pop-up window opens and, when acknowledged, the error is highlighted.
If not previously connected to a server, Service Studio initiates the connect to server dialog.
Service Studio checks if the server property Running Mode is Development.
Service Studio checks whether the local eSpace entity(ies) definition match the server's; otherwise the eSpace must be re-published. Naturally, at this stage, the eSpace must have been published at least once.
The query and its parameters' test values are sent to the server.
The query is translated into the specific DBMS Data Base Management System SQL that is being used by the eSpace.
A database transaction is started, the query SQL is executed, the transaction is rolled-back and the first result records are displayed on the Test Output canvas, which has the focus after this step.
When one of the above conditions is not met, a warning or error window pops up with instructions to follow.
Format the query Output: Make column appear or disappear from the query results by using the right-click menu of the Test Output tab.
Check tested SQL (only available in the simple query editor): Selecting the SQL tab displays the SQL generated for the query test.
Use the content of this tab
as a starter for your advanced queries, through the Copy/Paste
features! You will notice that the generated SQL includes code to limit
the number of results to the maximum number of records used by the test,
defined in the Test Inputs tab.
Close query: When you press the Close button, the query editor window is simply closed.
See Also