Basics SQL in Control

The database functions enable you to quickly carry out value queries on data points and elements. It is also possible in WinCC OA to create value queries with the SQL-Panel (for more information, see also the chapter Basics SQL-Panel).

WinCC OA provides functions that allow detailed querying of individual parts of data points. The results returned as data fields can be filtered and processed, for example, sort, add, search for minimum and others.

Keywords for data points

Data points in WinCC OA show the following structure:


The names for the individual levels (identifiers) are in part freely selectable in WinCC OA. On account of the freedom of naming, a unique assignment between a level and a name is not possible. For this reason, there are predefined keywords for addressing the individual levels:

Table: Keywords for WinCC OA

_SYS system level
_DP data point level
_EL element level
_KF config level
_DT detail level
_AT attribute level
_DPT data point type
_ALIAS alias (query only via WHERE keyword supported)
_COMMENT comment (from Resources::ParamLang - the language of the comment cannot be selected; query only via WHERE keyword supported)
_ELC element type as Control constant (DPEL_xxx)
_LEAF selects only leaf elements

For general reasons, there are also keywords for the first three levels in this table. However, the selection in these levels should already be made at wildcard level. Although the address "*:*;" is theoretically possible (simply everything in all systems) it is not advisable to use it. The evaluation of these keywords always relates to the entire line (that is to the FROM part of the query).

Chapter Description
Basics SQL in Control Introduction SQL in Control
Control functions for SQL Links to the functions that are needed for querying the WinCC OA database
Data management Data management in WinCC OA
Wildcards Explaining Wildcards and examples
Wildcards in the element identifier Using wildcards for data point elements
Queries Structure of the Query-commands and examples
SQL keywords Different query-commands and functionality with SQL-queries (for example MIN, MAX, TIMERANGE)
Basics SQL-Panel As from WinCC OA version 2.11.1, the SQL-Panel simplifies the process of creating value queries
Examples Examples for SQL-queries with current statements and Control functions
Tips and tricks Hints for using SQL in CONTROL
Glossary Important concepts and shortcuts
Summary and continuation to other chapters connected with SQL in Control Links to other chapters