Just wondering if there is any official documentation for unixODBC, e.g. how the configuration files have to look like and what parameters they expect? (I am using only a shell, no GUI) Even http://www.unixodbc.org/doc/ doesn't look very promising. I somehow have the impression, the best information are 3rd party pages, but can this be true?
You're right the documentation about
unixODBC still rare. For the configurations files,
unixODBC use only two config files:
/etc/odbcinst.ini: Here you define the driver
/etc/odbc.ini: Informations about connections
You can find a great documentation about installing this drivers and libraries on various linux systems here:
More complete documentation that include API for various languages can be found here:
All the config and installation stuff can be made without GUI :), an old good terminal shell suffice.
From a developer point a view (iused the C API few years ago, and i remember that it was a non trivial task): you need to connect and then perform a request.
To connect to the datasource using unixODBC and the
Init ODBC environnement by calling
Choose ODBC version number with
SQLAllocHandle()to init the connection handle
Now you can connect by calling
Once you have a connection handle and have connected to a data source you allocate statement handles to execute SQL or retrieve meta data. As with the other handles you can set and get statement attributes with
here you can find a good documentation on the C API:
http://www.easysoft.com/developer/languages/c/odbc_tutorial.html http://www.easysoft.com/developer/languages/c/odbc-tutorial-fetching-results.html http://www.easysoft.com/developer/interfaces/odbc/diagnostics_error_status_codes.html