Table of Contents

List and Query Management

Introduction

You define and run queries in the Query window. However, to organize and manage them, you use the Lists and queries window. The Lists and queries window is open by default. If it is closed, you can open it by choosing Window -> Lists and queries. By default, the window is empty. Once it is populated, as will be explained below, the window contains nodes representing queries and lists, as shown here:


Managing lists and queries means using the toolbar and the nodes' contextual menus to organize lists and queries in an optimal manner. By managing your queries and their results, you can do the following:

Managing Lists

A list is created as a result of running a query. A list in IJC corresponds to a list of IDs from an Entity. These IDs are the IDs of the row, which correspond to the primary key values in the database. Lists can be given names, saved, restored, edited, imported, and exported. New lists can be made from logical combinations of other lists. For example, you can create a new list that contains only the IDs common to two or more other lists. IJC creates a temporary list when you run a query and corresponds to the query results.

A list can belong to one of two categories—temporary and permanent. Temporary lists do not exist when you restart IJC, while permanant lists persist across restarts of IJC. Permanent lists are saved to the database and continue to exist until you choose to delete them. Temporary lists can be made permanent, and vice versa. Both sorts can be renamed or deleted.

Managing Queries

You can also manage queries. For example, you can recall previous queries and run them again. When a query is executed, a temporary query is created, allowing you to re-execute it at a later time. Like lists, there are two types of query—temporary and permanent. Like lists, they can be renamed or deleted. Temporary queries can be made permanent and vice versa.

It is important understand the difference between lists and queries. This can be best explained in terms of what happens when you re-apply the list or query when the contents of the database have changed. The list is a static list of IDs. It will not reflect any changes to the database. The query will be re-run when it is re-applied and will reflect any changes to the database and so may generate different results. For instance, this allows you to ask questions like "What new results are in the database since I last ran this query?". To do this, save the list of results (e.g. make the list permanent and give it a sensible name) each time you run the query. Then compare today's results with those from last time by finding our what is in today's list that was not is the other list.

The Lists and Queries Window

By default, the Lists and Queries window is empty and the toolbar is disabled. THe contents or the Lists and Queries window corresponds to the context of the current Entity. Usually this will correspond to the Entity at the root of the particular Data Tree that is selected, usually corresponding the the Grid View or Form View that is currently selected. If, for instance you switch to a view of a different Data Tree then the Lists and Queries window contents will be updated so that it contains the lists and queries for the Entity at the root of the Data Tree of that view. The Lists and Queries window shows four nodes, one for each of the two types of queries and one for each of the two types of lists. After you run a query, the temporary query node and the temporary list node each have subnodes. The temporary query node shows the executed queries and the temporary lists node shows the results of the query.

Queries can be deleted and executed. Lists can also be edited, sorted, exported, and imported. These actions are available from the toolbar. By right-clicking on a query or a list, you are able to specify that they should become permanent. Details on all these activities are provided below.

Creating lists

Whenever you run a query, a temporary list is created, containing the results. Right-click on a list and you see the following:

The available options are as follows:

Using list operations

You can perform operations on two or more lists at the same time. Select multiple lists and then open the drop-down shown below:

A list of operations is shown. They are as follows:

When you make a choice from the above operations, the following dialog is shown, with the corresponding operation selected:




You can apply the operation to an existing list or you can create a new list to which the operation will apply. Use the "Save result to" area, at the bottom of the above dialog, for this purpose.

Restricting searches to a list

By default, a query is applied across the entire database. However, you can narrow the search so that it is applied to a list. As a result, you are able to perform queries within results attained from previous queries. Use the Domain drop-down in the Query window for this purpose. See the documentation on Running queries for more details.

Creating queries

Queries are created using the query panel. See the documentation on Running queries for more details. When a query is executed, the query definition is saved as a new temporary query. The list of results is stored as a new temporary list.

Managing queries

To manage queries, right-click a query. You should see the following:


You can now choose the following:

Options for list and query management

To set options for managing lists and queries, choose Options under the Tools menu and then click Miscellaneous -> Lists and Query. You should now see the following:




You can set the following options:

Sharing lists and queries

If you are using a multi-user database then you can use lists and queries that other people have created. To do this right click on the Permanent Lists or Permanent Queries node and select Copy list/query from other user. A dailog will open that allows you to specify the user and the list/query.




Note: This process creates a COPY of the list or query. Any changes the other user subsequently makes will not be reflected in your list/query. You would need to take a fresh copy.



Copyright © 1998-2008 ChemAxon Ltd. All rights reserved.