ODBC database¶
Applications
Used to interface the project with Microsoft SQL Server 2012 (or higher) and MySQL Server databases.
References
ODBC and DSN driver configuration
In Windows environments, the ODBC drivers used by the DSN (Database Source Name) must already be installed on the system. The following ODBC drivers are supported:
MySQL ANSI
MySQL Unicode
SQL Server
If the DSN property is specified, the ODBC Database connection parameters are taken from the same DSN. Any properties specified in the ODBC Database object are added as parameters to those present in the DSN configuration.
Note
it is not possible to overwrite the parameter values already present in the system DSN.
If not present, the TCP port property is assigned a value with the default value for the DBMS (e.g.: for MySQL the default port is 3306). The Username and Password parameters are not supported inside DSN and must be specified by the relative properties of the ODBC Database object.
Configure a DSN in Windows
Tip
to configure a DSN use ODBC Data Sources in the 64-bit version.
In the ODBC Data Source Administrator window, on the DSN System tab, click Add, choose a supported driver and complete the configuration.
Supported data types
Below is the mapping between the UNIQO HMI OPC UA data types, the data types supported by Microsoft SQL Server and MySQL databases, and the OPC UA data types resulting from an SQL query in UNIQO HMI.
MS SQL Server data type |
MySQL data type |
||
---|---|---|---|
Boolean |
BIT |
BIT(1) |
Boolean |
Integer |
BIGINT |
BIGINT |
Int64 |
UInteger |
BIGINT |
BIGINT |
Int64 |
byte |
SMALLINT |
SMALLINT UNSIGNED |
Int16 |
SByte |
SMALLINT |
TINYINT |
Int16 |
Int16 |
SMALLINT |
SMALLINT |
Int16 |
UInt16 |
INT |
MEDIUMINT UNSIGNED |
Int32 |
Int32 |
INT |
INT |
Int32 |
UInt32 |
BIGINT |
BIGINT UNSIGNED |
Int64 |
Int64 |
BIGINT |
BIGINT |
Int64 |
UInt64 |
BIGINT |
BIGINT UNSIGNED |
Int64 |
Float |
REAL |
FLOAT |
Double |
Double |
FLOAT |
DOUBLE |
Double |
DateTime |
DATETIME |
DATETIME(3) |
DateTime |
String |
TEXT |
TEXT |
String |
NodeId |
VARBINARY (max) |
BLOB |
NodeId |
Note
since ODBC uses signed data types, unsigned UInt64 data are mapped and handle up to the maximum value of (2^{63} - 1), due to a bit allocated to the sign.
Note
the DateTime data type is limited to an accuracy of one thousandth of a second.
Properties¶
Name |
BrowseName |
DataType |
Description |
---|---|---|---|
DSN | DSN |
DSN (Database Source Name) |
|
DBMS type | Type |
Type of database server, among those supported |
|
Username | Username |
Name of the user for access to the database |
|
Password | Password |
User password for access to the database |
|
Database | Database |
Name of the desired database in the database server |
|
Server | Server |
IP address or hostname of the database server in the network |
|
TCP Port | Port |
TCP port of the database server (if empty, SQL default = 1433, MySQL default = 3306) |
|
Tables | Tables |
Collection of ODBCStoreTable |
Database tables
(Inherited from Store)
|
Max column name length | MaxColumnNameLength |
Maximum length of column names
(Inherited from Store)
|
|
Max columns count | MaxColumnCount |
Max columns count
(Inherited from Store)
|
|
Data type compatibility map | DataTypeCompatibilityMap |
Map of the compatibility for the column data type
(Inherited from Store)
|
|
Status | Status |
Database connectivity status
(Inherited from Store)
|
See also
Concetti correlati
Procedure correlate
Esempi applicativi