Database Table Tag

Help Contents

Introduction

The Database Table Tag Database Table Tag stores an application specific database table. System Integrators can use database tables to store application specific information, for example:

The columns in the Database Table are edited using the Database Table Editor.

Configuration Properties

The Database Table Tag supports the configuration properties of the Core Tag plus these properties:

Property Type Version Description
RowLimit UDINT 3.35 The maximum number of rows allowed in the table.
SQLTableComment STRING 3.35 The remarks associated with the SQL Table.
SQLTableName STRING 3.35 The name of the SQL Table.

SQLTableName Property

The SQLTableName property defines the name of the table in an SQL Statement.

When an SQL statements references a Database Table Tag, you must qualify the name with the schema name "DatabaseTable". For example:

SELECT *
FROM DatabaseTable.<SQLTableName>

Where <SQLTableName> is the value of the SQLTableName property.

For more information about the format of SQL statements, see Fernhill SCADA Structured Query Language (SQL).

If you want the table name to contain spaces or special characters, use a delimited table name:

"Name With Spaces !"

The SQLTableName property must be configured correctly otherwise the Database Table will not be visible from SQL. For example:

Dynamic Properties

The Database Table Tag supports the dynamic properties of the Core Tag, plus these dynamic properties:

Property Type Description
TableState UINT A code providing information about the table.
ErrorMessage WSTRING The errors in configuration of the Database Table.

TableState Property

The TableState property provides information about the configuration of the table:

TableStateDescription
0 Initial state. Should not appear in normal operation.
1 Invalid table name. The SQLTableName property is not a valid SQL Identifier.
2 No table name defined. The SQLTableName property is blank.
3 Table name too long. The SQLTableName is more than 128 characters.
4 Duplicate table name. The SQLTableName is a table name that is used by another Database Table.
15 The Database Table is configured correctly and visible to SQL statements.

Tag Commands

The Database Table Tag does not support any tag commands.

Relationships to Other Tag Types

The Database Table Tag builds on the features of these tag types:

Further Information

Core Driver

For information about all the tag types provided by the core driver.

Fernhill SCADA Structured Query Language (SQL)

To learn about SQL in Fernhill SCADA.

SQLCommand Data Object

To learn how to access a Database Table Tag from an IEC 61131-3 code.

Glossary

For the meaning of terms used in Fernhill SCADA.