ODBC database write in real-time
Latest version: 5.0.1 build 1126. November 28, 2025.
The ODBC database module provides export of parsed data to any ODBC compatible database. It runs INSERT and optional UPDATE operations without requiring you to write SQL using only dialog-driven setup. The configuration workflow covers database selection, connection attributes, error handling, and field binding. Supported targets include at least MS SQL Server, Oracle, PostgreSQL, MySQL, Interbase, Microsoft Access, Excel, and generic CSV/text files that present as ODBC data sources.
What the module does
The module accepts parser variables and writes them into table columns. It converts values between similar data types when required (for example, string to date or integer to float) and applies default values when a parser variable is missing or null. The configuration dialog exposes DSN selection, optional file DSN support, connection attributes such as database file name, login, and password, and driver specific options like "SERVER PORT=3306" for MySQL.
Practical examples
Example: Simple insert into MS SQL table: the ASCII parser produces variables DATE_TIME_STAMP, TEMPERATURE, and DEVICE_ID. The module executes the INSERT automatically when a new data packet arrives.
Setup and connection
Open the module configuration from Options → Settings → Modules → ODBC database → Setup. Create or select a DSN: system DSN for service mode or shared system use, or user DSN for user connections. Use the ODBC Data Source Administrator to add or verify connections.
Table creation and columns binding
Design your target table according to ANSI SQL92 rules: use Latin letters, digits, and underscores in column names. Avoid reserved SQL keywords unless quoted with backquotes (`). Most databases provide free visual tools to create tables. Then you can import an existing table structure via the Import button or add all table columns manually. After import, map each column to a parser variable, set the column data type, and provide a default value.
Automatic binding workflow
- Click Import. The module lists available tables for the selected DSN.
- Select a table and click OK, and the import populates columns into a tree view.
- Map parser variables (for example, DATE_TIME_STAMP) to columns and set data type.
- Save and test the database connection by receiving test data from your device or data source.
- The module will attempt an INSERT immediately and report any error in the main window with diagnostic text.
Integration examples with Advanced Serial Data Logger (ASDL)
Scenario: ASDL receives serial packets from a meter and parses variables DATE_TIME_STAMP, METER_ID, and ENERGY_KWH. Configure the ODBC module to connect to a system DSN named "EnergyDB". Import the table "energy_logs" with the following columns: recorded_at (DATETIME), meter (VARCHAR(32), energy (FLOAT). Binding example:
Parser item → Column DATE_TIME_STAMP → recorded_at (DATETIME) METER_ID → meter (VARCHAR) ENERGY_KWH → energy (FLOAT)
Incoming packet example:
DATE_TIME_STAMP=2025-01-02 08:00:00 METER_ID=MTR-1002 ENERGY_KWH=42.7
Exported SQL executed by the module (implicitly, the plugin builds the insert SQL statement automatically):
INSERT INTO energy_logs (recorded_at,meter,energy)
VALUES ('2025-01-02 08:00:00','MTR-1002',42.7)
Key features
- Configure the plugin using dialogs: no SQL required for basic inserts and updates.
- Supports any ODBC-compatible database: MS SQL, Oracle, PostgreSQL, MySQL, Access, Excel, CSV and more.
- Automatic data type conversion between parser variables and column types.
- Import table structure and bind parser variables to columns with defaults and primary key columns detection.
- Configurable error handling: stop, notify, log, or reconnect on failure.
- You can use file DSNs like MS Access, CSV, and Excel.
- You can set your own connection attributes to tune the driver.
Summary
Without writing SQL, the ODBC Database module lets you export parsed data to databases and file databases in a unified way that doesn't depend on the underlied database. Configure DSNs, and bind parser variables to columns using dialog driven setup.
Read more about other plugins:
All plugins | SQL Database Professional | Cloud Database Professional | ODBC database | Local (desktop) database