Installing iODBC on the HP-UX platform ====================================== The iODBC driver manager is available as a tar archive for HP-UX 10.20 and above. To install, please follow the directions below. Please note that administrative cpabilities are required. tar xfp /tmp/libiodbc-2.50-hpux.tar The files are installed to /opt/iodbc and /etc/opt/iodbc. Configuration ============= In order to make use of the iODBC driver manager you need to create a /etc/opt/iodbc/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 copy the odbc.ini template file. cp /etc/opt/iodbc/odbc.ini.sample /etc/opt/iodbc/odbc.ini 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. 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/libsqlrodbc.so This instructs iODBC to use the SQL/R driver for this data source. 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.