Skip to content
Branch: master
Find file History
Linl update
Latest commit b09c35a Jul 11, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
src update Jun 10, 2019
test_setup update Jun 10, 2019
tests update Jun 10, 2019
windows mssql odbc guide update Jun 10, 2019
DolphinDBODBC.txt update Jun 10, 2019
Makefile update aws, odbc, zlib Aug 11, 2018 update Jul 11, 2019
myodbcTutorial.txt update aws, odbc, zlib Aug 11, 2018
odbc.cfg exec = execute May 14, 2018
utfcpp_LICENSE update Jun 10, 2019

DolphinDB ODBC plugin


With this plugin, you can easily pull your data from existing databases that support ODBC interface.


This plugin requires corresponding database drivers for ODBC.


# install unixODBC library
apt-get install unixodbc unixodbc-dev

# SQL Server ODBC Drivers
apt-get install tdsodbc

# PostgreSQL ODBC ODBC Drivers
apt-get install odbc-postgresql

# MySQL ODBC Drivers
apt-get install libmyodbc

# SQLite ODBC Drivers
apt-get install libsqliteodbc


To compile the plugin, type following command in a shell.


This will compile the plugin into a shared library named

Loading plugin into DolphinDB

You can use dolphindb's loadPlugin function to load the plugin. This function takes a plugin description file parameter. For example, the follwing dolphindb script loads the plugin described by DOlphinDBODBC.txt.


Using the plugin

The plugin provides three functions.


odbc::connect takes a odbc connection string as the paramter and opens up a connection via ODBC with this string and return the connection handle to user. For more information regarding the format of connection string, see ;


odbc::close closes an odbc connection associated with the handle.

odbc::query(connHandle or connStr, querySql [,t])

odbc::query queries the database via connHandle or connStr and return the results as a dolphindb table.
The first argument could be connection handle or a connection string.
The second argument is the query string.
The last argument is a optional user-provided table. If provided, query results will be appended to the table. Note that, the table schema must be compatible with the results returned from ODBC or an exception will be thrown.

You can ommit odbc:: prefix by introducing obdc module namespace.

use odbc;
You can’t perform that action at this time.