The 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.
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 | A comment string about the table. The comment string will appear in SQL metadata. |
SQLTableName | STRING | 3.35 | The name of the table in SQL Commands. The value must be a valid SQL Identifier. |
The SQLTableName property defines the name of the table in an SQL Statement.
When an SQL command 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 Commands, see Fernhill SCADA 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:
The Database Table Tag supports the data properties of the Core Tag, plus these data properties:
Property | Type | Description |
---|---|---|
TableState | UINT | A code providing information about the table. |
ErrorMessage | WSTRING | The errors in configuration of the Database Table. |
The TableState property provides information about the configuration of the table:
TableState | Description |
---|---|
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. |
The Database Table Tag does not support any tag commands.
The Database Table Tag builds on the features of these tag types:
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.
To learn how to access a Database Table Tag from an IEC 61131-3 code.
For the meaning of terms used in Fernhill SCADA.