Graphical query tool

The graphical query tool includes a feature used to create inquiry screens that display the results of database queries. It works by temporarily extracting data into a table, then running a query on that table. The inquiry can be made at multiple levels of detail, defined by successive page breaks.

You can retain the results of your most recent query in this temporary table (unless the query is shared). Using this functionality involves 3 distinct phases:

  1. Define the query using this Graphical query tool function (GESALT)

  2. Run the query by clicking the Run button.

  3. Consult the results if the query has already been executed.

You can build queries using table fields or expressions. Table joins are automatically determined based on the data dictionary, but you can also define joins manually by dragging a field from one table to another. To do so, the destination field must be part of a key.

Additionally, 2 complementary tools are available:

  • The Query tool function (GESALH), offering similar functionality in a tabular interface.

  • The SQL query tool function (GESALQ), which uses the same inquiry screens but allows you to design queries directly in SQL.

Prerequisites

Refer to the implementation documentation.

Screen management

The screen is defined in 5 tabs:

You can edit your query across multiple tabs, but only the first one is mandatory.

The header provides information to identify the query, along with general configuration settings.

Fields tab

Use this tab to define and organize the information to be edited using a visual editor.

Based on the elements configured in this editor, the query designer automatically generates a query on tables linked by join conditions.

In simple cases, the settings in this tab are sufficient, and it is not necessary to complete the next tabs.

Advanced tab

This tab is optional. It allows you to define:

  • Presentation criteria (such as page numbering and report layout)

  • Additional selection criteria

  • Specific join conditions

Join conditions are useful in two cases:

  1. When the automatic join algorithm fails.

    • This is easy to identify because an error message displays when validating the query.

    • Often, adding a link to one of the tables not described in the dictionary resolves the issue. Other links remain automatic.

  2. When the automatic join does not match the expected logic.

    • In complex cases, multiple links can exist between tables, but the algorithm stops at the first one it finds.

    • To verify the join, use the Info > Links action button, which displays the details of the detected links.

Access tab

Use this tab to define the access conditions to the query and the extracted data.

Graph tab

You can edit this tab only if a graphical representation is available for the query. It allows you to define how the data displays in the chart.

Specific buttons

Error messages

Other than the generic messages, the following error messages can appear when entering data:

Too many sort criteria

The request exceeds the allowed limits. The number of sort criteria cannot exceed 8.

Too many ranges

The request exceeds the allowed limits. The number of ranges cannot exceed 10.

Too many totals

The request exceeds the allowed limits. The number of totals cannot exceed 10.

Table not defined

A calculation formula was used in an expression that references fields from a table that is not linked.

xxx: Non-existent table

The table does not exist in the dictionary.

yyy: Non-existent field

The field does not exist in the dictionary.

Incorrect index

A field is indexed with a value that exceeds its dimension.

Impossible links

The links between the tables could not be established from the dictionary. This can indicate an error in the request, or you might need to explicitly define the links in detail under the Advanced tab.

This field has already been selected

An attempt was made to add a field to the selected fields, but this field already exists.

Unknown action

The Flash component triggered an action that is not recognized by the supervisor.

Impossible links. The fields must be of the same type.

You cannot create links between table fields of different types. For example, a numeric field cannot be linked to an alphanumeric key field.

Impossible link. Key component already entered.

When you create a link using a table’s key, links must also be established for all parts of that key. This message displays if you attempt to create a link on a field that is not part of the key.

Impossible link. Incomplete existing key.

The link was not defined for all fields in the key.

Impossible link. Non-existent key.

An attempt was made to set up a link on a field that does not belong to a key.

At least one description-type field and one value-type field are required to use this graph.

When the Graphical representation option is active, you need to select one field for the graph title and at least one other field for the graph calculations.

Data type not managed

You cannot use CLOB (text) and BLOB (image) fields in expressions for the selected fields.

Tables used

Refer to the implementation documentation.