In QuickHMI, you have the option of displaying entire table contents from databases on the user interface.
To create a database query (SQL statement) , a database connection is of course required.
The first step is to click on
“Database” / “Queries” in the Project Explorer.
In the window that opens, click on the“plus icon” to create a new database query.

Then assign a “Name“, select the “Connection” and select the execution mode.
Then enter the desired SQL and save your entries.
There are 2 execution modes available for database queries. The modes differ firstly in when and by whom they are triggered and secondly in which users are shown which data.
Interval
The database query is automatically executed by the server at a defined interval (fastest interval 500ms) .
All users are automatically shown the same current data.
Manual
The database query is executed once when the server is started in order to obtain an initial data status.
After that, this query is only executed when a user interacts (by means of a created action, e.g. when a button is pressed).
The table is now filled with the current database data and is not updated until the action is executed again.
If other users perform an action during this time that affects this database query, this has no effect on other users.
In SQL, you can use placeholders that are replaced by the content of variables at the time the query is executed.
In this example, we want to use the number of currently connected clients in an email. We can find this value in the system variable “current_session_count“.
The data source name of the system data source is “System“.

To use a variable as a placeholder in a query, precede the name of the variable (including the data source name) with an @ sign.
Data source and variable names are separated by a dot. In this case, @System.current_session_count.
Not all variables can be used as placeholders! Only global variables can be used.
Global variables are:
- Variables from data sources that have been created by the user.
- Internal variables that have been created as global.
- The system variables“current_session_count“,“active_alarm_count” and all data source status variables.
No global variables are:
- All variables of the system data source (with the exception of those mentioned above).
- Internal variables that have been created as local.
Placeholders can only be used where JDBC parameters (?) can normally be used. At runtime, all placeholders are replaced by JDBC parameters. Data types of variables therefore play a role here.

The new “DatabaseTabel” element now appears in the control elements on the left-hand side, which, like all other elements, can also bedragged and dropped onto the interface.

In the “Properties” for the control element under “DatabaseQuery“, select the previously created database query.

Once all entries have been made and the runtime is executed, the table from the database is displayed.

The data can be sorted as required using the columns. (The display may vary in detail in the future).
Brief explanation of the element-specific properties
- Info
If this option is activated, information about the table is displayed, including information about filtered data.
This option can be used to activate or deactivate this function.
- Ordering
Activates or deactivates the option to sort the data in the table according to the desired columns.
- Filtering
Activates or deactivates the search function within the table.
- Paging
Controls whether the user can change the number of data records displayed on a page at runtime.
If this option is deactivated, all data records are always displayed.
- PageSize
A sequence of numbers (separated by a comma) can be entered here, which specifies,
which selection options the user has when paging is activated.
In the example below, paging is activated and the page size is set to 50.
The user is therefore not given the option of adjusting the page size at runtime.
By entering “50, 100, -1“, a selection could be made between 50, 100 and all entries.
With the exception of -1 (this stands for all data records on a page), numbers must be positive.

