Database

In den Database tables individual data about the application or visualization is stored. This data can be evaluated or displayed both on the visualization and directly in the application.

Note: Please note the different licenses so that the tables can also be edited.

Application Examples

There are various scenarios where tables are used.

For example, temperatures for hotel guests can be stored and retrieved and saved independently in different rooms using guest ID.

To export data to an external storage or import it again, the database table can also be used.

Structure of a Table

Every table has its own structure. This does not contain data types like in the PLC. In addition, no versions can be stored in the editor because all operations can directly affect the data records.

Warning: If you delete a column and then click Apply, all data in the column will be irrevocably deleted.

The structure can only be edited in the corresponding database table in the library.

Every table has a first column named id. The values of this column may only occur once in the entire table. Each further column can have a different name. However, this may only occur once. The name defines the identifier of the column. In addition, each column can be assigned a title. The title is stored in the opened language of the database table.

Data Types

Each column can have a different data type. This can also be changed later. This may lead to data loss depending on the content.

The entire database works with the same character set as the application. This must be taken into account when exporting and importing data. The character set is fixed to UTF-8.

bool

Defines a boolean column. This can have two states, TRUE or FALSE.

int

Defines a signed number that can be at most 8 bytes long. The range is -9'223'372'036'854'775'808 to 9'223'372'036'854'775'807.

real

Defines a floating-point number with double precision. Allowed values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0 and 2.2250738585072014E-308 to 1.7976931348623157E+308.

datetime

Defines a column as a timestamp in seconds. The value can be passed using DT#2016-03-25-22:12:00 or in milliseconds. The milliseconds are rounded to the next second.

varchar

Defines a column as a string. This is equivalent to a variable name. The maximum length is at most 255 characters.

text

Defines a text column with a maximum length of 16'777'215 (224-1) characters.

Note: This type does not support indexing.

Using Indices

A table index can be used to sort a table faster if filters are applied over other columns. A column with the data type text cannot receive an index.

Using multiple indices can slow down writing of the data. In addition, more storage space is required.

Editing Data Records

Data records can be edited in various ways. This can be done directly in the editor or via application.

Note: When duplicating a database table, the data records are not copied.