General presentation

The graphical query designer features a function that is used to create the inquiry screens used to display the results of the queries run on the database. It operates by temporary extraction of the data in a table, then by running an inquiry on this table. The inquiry can then be made at several levels of detail, defined by successive page breaks.

The structure of this temporary table enables each user to keep the results of the last query run on the database (unless it is a shared query). Using this functionality implies three different phases:

  • definition of the query by this function,
  • launch of the query (either using the Execute button or using the inquiry function and then the data refresh request).
  • inquiry of the query if it has already been executed.

A query can be formed from table fields or expressions.

Joins between tables are determined automatically from the dictionary, but is is possible to define them explicitely by drag-and-drop from the field of one table to another. As a preliminary condition, the destination field must belong to a key.

Let us underline the existence of two additional tools: An equivalent query tool to the present one, but in grid mode, and an SQL query tool going through identical inquiry screens but whose purpose is to design queries based on the SQL language.

Management of the interface

The query creation field is comprised of a floating pallet, a design area for the template and another area to place the selected fields.

Floating pallet

It contains the following buttons:

  • Table: Opens a selection list to add a table.
  • Expression: Opens the formula wizard in order to add an expression.
  • Erase: Reinitializes the query.
  • Codes: Checkbox to display the codes of the fields, in addition to the descriptions.
Design area for the template
The tables

The added tables are represented with their joins in this design area.

To add a table, click on the "Table" button of the floating pallet.

The possible actions on a table are:

  • Deletion by clicking on the cross in the upper right corner of the table. Warning, a table can only be deleted if all its links have been deleted and all its fields have been removed from the area where said fields have been placed.
    ../FCT/GESALT_01_01.jpg
  • Decrease/Increase via right-click on the button located to the left of the cross.
    ../FCT/GESALT_01_01.jpg  ../FCT/GESALT_01_02.jpg
  • Moving using the title bar or the lower bar.
  • Resizing of the table by means of the grip button in the lower right hand corner of said table.
    ../FCT/GESALT_01_03.jpg
Joins

The joins that have not been created automatically can be created by drag-and-drop from the source table field to the target table field. A left outer join is then created.

Clicking on a join displays a menu used to change the join type (left outer or inner join) or delete it.

Background

A drag-and-drop action to a free space in the design area makes it possible to reposition this space. Double-clicking is used to reposition the design area with respect to its origin.

../FCT/GESALT_01_04.jpg

Selected field location area

The area where the selected fields are located is used to:

  • View the fields in the form of thumbnails,
  • Modify the order and properties of these thumbnails (sort, cumulation, ranges, visibility),
  • Manage the expressions,
  • Manage the query breaks.
Add a field

To add a table field, it is necessary to double-click on it or to perform a drag-and-drop action to the selected field location area.

Add an expression

To add an expression, it is necessary to click on the "Expression" button of the floating pallet.

Edit an expression

Click on the description of the expression to display the window of its properties.

Modify the properties of a thumbnail

Click on the icons to modify the values of the properties. A faded display specifies a negative value (for instance: not sorted).
../FCT/GESALT_02_02.jpg  ../FCT/GESALT_02_03.jpg
Meaning of the icons from left to right: Visible, sort, cumulation, range entry

Delete a thumbnail

Click on the cross in the upper right hand corner of the thumbnail.
../FCT/GESALT_02_01.jpg

Move a thumbnail

Click on the grip in the upper part of the thumbnail and move it without releasing pressure on the mouse button, then release on required position. Thumbnails can only be moved on a similar level.
../FCT/GESALT_02_01.jpg

Create a break level (group)

Click on the thumbnail grip, a menu appears with different descriptions. Select "Create a group" to put the thumbnail at the top of a new group.

Move a thumbnail to an existing break level

Click on the thumbnail grip, a menu appears with different descriptions. Select "Group N" where N represents the group level, to move the thumbnail to the bottom of the selected level.

Prerequisite

SEEREFERTTO Refer to documentation Implementation

Screen management

The definition of a query is performed on several tabs but only the first one is mandatory.

Header

This section provides information to identify the query and some parameters of a general nature.

Tab Fields

This tab is used to define and regroup the information to be edited thanks to a visual editor.

Using all the information defined in this editor, the query designer specifies a query on tables linked by join conditions. Thus, in simple cases, it is not necessary to complete the next tabs.

Tab Advanced

Entering this tab is not mandatory. It is used to specify:

  • criteria related to the data presentation (page numbering, report used, etc.).
  • additional selection criteria.
  • specific join conditions.

The join conditions are useful in the two following cases:

  • if the automatic join algorithm does not work. This case is easy to recognize since an error message is displayed upon query validation. Sometimes it is sufficient to add a link to one of the tables whose links are not described in the dictionary to solve this case (the definition of the other links remains automatic).
  • if the join algorithm links tables in a way that differs from what was expected. As a matter of fact, in complex cases, several links may exist between tables. However, the algorithm stops when the first links is found. In order to verify if the join is in conformity with what was expected, it is possible to use the button Infos / Links, which gives the details of found links.

Tab Access

This tab is used to define the access conditions to the query and the extracted data.

Tab Graphic

This tab can only be entered if a graphical representation is available for the query. The way the data are displayed on the graphic is then defined.