4 10 Execute a Linked Query

LANSA Client

4.10 Execute a Linked Query

Linked queries give you the ability to drill down into your data using the results of one query to act as the search conditions for a subsequent query.

For example, imagine that you wanted to view the sales by Country and check particularly high or low sales as you find them.

Using linked queries, you simply create a query showing you the sales for each country. This becomes your primary query. Then you create another query which shows you the Sales History and link it, as a secondary query, to your first query. You could also create another linked query to show you the Warehouses within each Country.

To use the linked query:

  • Run the primary query.
  • From the result in the Results window, highlight a row that you would like to interrogate.
  • Run the linked or secondary query by selecting the Linked Queries command from the Results menu. From the sub-menu, select the query to be run by clicking on the name with your left mouse button.

 

LANSA Client will automatically handle all the relevant file linkages and will display the results of the new query in a new Results Window.

  • You can then return to the primary query and interrogate another Country's sales in the same way.

If no linked queries have been defined, you will not be able to select the Linked Queries command.

The names displayed for the linked queries in the drop down list are the names assigned to the queries via the Linked Query Option dialog box. If the linked queries have not been assigned names, then the descriptive name of the file will be used instead.

Refer to LCL006 - Build, Execute and Save a Linked Query in the LANSA Client Tutorials for step by step details of creating linked queries.

 

Further Information

Ý 4. Work with Query Results