The softwares in SAFE X3 technology include a query tool that is used to create inquiry screens from queries expressed in the form of a list of fields obtained from the tables in the database, these tables being linked either by default or by explicitly named links. This approach makes it possible for a user to rapidly create queries without using a specific query language, by having a simple understanding of the tables in the database, knowledge that can be aided by the use of the technical documentation (notably MCD). In addition it provides a user friendly inquiry interface in the multi-column screens with the availability of using a tunnel.

This query tool nevertheless has several limitations, for example with respect to complex queries that cannot be strictly expressed in the form of a list of fields. Thus, for users that have more technical ability and an understanding of the SQL language, this query tool does not easily give the desired results.

It is for this reason that an additional tool has been created, the SQL query tool, which is used to express queries by using classic SQL language. This SQL query tool is only distinguishable from the previous query tool by its setup screen. In fact, the screens created by this query tool are called by the same request execution function as that used by the standard query tool.

This signifies that, like the standard query tool, the SQL query tool functions by the temporary extraction of data from a table (the same as the classic query tool), then by consultation of this table. However, the inquiry can only be carried out on one level, breaks and totals not being possible at this level.

Similarly to the classic query tool, the structure of this temporary table means that each user conserves the results of the last request carried out in it and the use of this functionality includes three different steps:

  • definition of the request by this function, then Validation in order to create the corresponding inquiry screen.
  • launch of the query (either using the button, or by using the interrogation function and the data refresh request).
  • inquiry of the query if it has already been executed.

Prerequisite

SEEREFERTTO Refer to documentation Implementation

Screen management

Header

The header provides information to identify the query and some setups of a general nature.

Tab Setups

The first tab is used to enter the query and additional general parameters.

In the table called Columns, information to obtain a more precise presentation will be provided. Upon execution, the query returns a list of values which are loaded in the grid. When there is no further information:

  • the grid columns do not have a title.
  • they have the type alphanumeric, numeric, they are dates without much details, depending of the data types returned.

Moreover a fix SQL query does not have much interest. It is necessary to integrate the parameters which are to be entered at the moment of the launch. This is enabled by the grid entitled Parameters.

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.

Important note

It should be noted that no filter linked to authorizations is carried out (irrespective of whether they are authorizes by role, by site or by access codes) with the SQL query tool. It is therefore advisable to protect the queries of this type with an access code to limit the display rights and even more the execution of these queries. Similarly, the access to this function must normally be limited to a restricted list of users.

Specific Buttons

Validate

generates the screen associated with the inquiry and verifies the query by submitting it to the database for the verification of the syntax and the semantics.

Execute

Is used to execute the current query. The execution is launched by updating a temporary table passes to the function to view queries, which makes it possible to view the result of the query.