Installing iODBC on the Linux platform ====================================== Installing of iODBC on Linux may not be necessary if your distribution already comes with a version of iODBC. The iODBC driver manager is available as a rpm archive. To install, please follow the directions below. Please note that administrative cpabilities are required. rpm -Uvh /cdrom/-2.50-3.i386-.rpm where is either "libiodbc" to specify the run-time only package which provides the functionality (shared library) required for applications to use the iODBC driver manager. The "libiodbc-devel" package includes additional development files (header and library files) required to compile ODBC aware applications in addition to the run-time. specifies the libc version used by your system or application. The following libc versions are available: libc5 - This was used by SuSE Linux upto version 5.x and RetHat Linux 4.x. glibc2 - This was used by SuSE Linux 6.0 - 6.1 and RedHat 5.x This is also referred to as libc6 or glibc2.0. glibc2.1 - This is used by current Linux distributions. Files are installed to /usr/lib, /etc and /usr/include (for the development package) directories. A default /etc/odbc.ini is installed. You need to change your /etc/odbc.ini like below to use iODBC with SQL/R ODBC. Configuration ============= In order to make use of the iODBC driver manager you need to create a /etc/odbc.ini configuration file. 1. Local data sources --------------------- If you only have local data sources served through SQL/R ODBC (the sqlrodbcd server runs on the same system) you can simply put the fowllowing in your odbc.ini. [Default] Driver = /opt/sqlr2/lib/libc6/libsqlrodbc.so This will make use of the SQL/R ODBC driver as the default driver so data sources only need to be configured in the SQL/R odbc.dsn file. Replace the /libc6/ part as appropiate for your installation. 2. Using remote data sources ---------------------------- In case data sources are provided by a different server machine (where sqlrodbcd is running on), an entry like below is required in addition for each remote datasource. [data_source_name] Server = name_or_ip_address_of_server Service = service_name Where - data_source_name is the name of the data source - name_or_ip_address_of_server is the host name or IP address of the server system - service_name corresponds with your setting defined in odbc.cfg. The default is either sqlrodbc or 8003. For example: [sqlr_ex] Server = lxmike Service = 8003 In order to access the data source sqlr_ex the server lxmike would be contacted on port 8003. 3. Using different ODBC drivers ------------------------------- It is possible to use different ODBC drivers with the iODBC driver manager (eg. SQL/R ODBC, MySQL, ADABAS). In case the SQL/R ODBC driver is not used as the default driver, you need to specify the SQL/R ODBC driver using the Driver directive like below: [data_source_name] Driver = /opt/sqlr2/lib/libc6/libsqlrodbc.so This instructs iODBC to use the SQL/R driver for this data source. Replace the /libc6/ part as appropiate for your installation. 4. ODBC meta data ----------------- THe iODBC driver makes use of meta information which could be specified in the odbc.ini. The "ODBC Data Sources" section in the odbc.ini file is used by the SQLDataSources() function which allows applications to retrieve a list of configured data sources. It is used like below: [ODBC Data Sources] data_source = data_source_description ... For example: [ODBC Data Sources] sqlr_ex = SQL/R Example Database acctd = Accounting database 5. Personal and alternative odbc.ini files ------------------------------------------ In addition to the global odbc.ini file, iODBC allows to use a personal or a specific odbc.ini file. A personal odbc.ini file is created by creating the file .iodbc.ini in the home directory of the user. It has the same syntax as the global one and if present the global odbc.ini file is no longer used. If the environment variable ODBCINI is present, the iODBC driver manager will use it to locate the odbc.ini file. Neither the global file nor a personal odbc.ini file is used then.