4.9 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:


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

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 LCE240 - Linked Queries for step by step details of creating linked queries.