Accessing ODBC Databases from IBM UniVerse and UniData

Download ODBC drivers for Universe/Unidata. How to access ODBC databases such as MS SQL Server, Oracle, DB2 and MS Access from UniVerse/UniData.

Contents

Introduction

Easysoft ODBC drivers enable the IBM U2 data servers, UniVerse and UniData, to access ODBC databases such as Microsoft SQL Server, Oracle and Microsoft Access from UNIX and Linux. For example, to connect UniVerse/UniData on IBM AIX to SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2012, SQL Server 2014, SQL Server 2016 and SQL Server Express databases, download the SQL Server ODBC driver.

To access Oracle databases from UniVerse/UniData, download the Oracle ODBC driver. To access other databases for which an ODBC driver is available, for example MS Access, download the ODBC-ODBC Bridge.

Connecting to an ODBC Database from UniVerse/UniData

Download the Easysoft ODBC driver for your UniVerse/UniData platform. (Registration required.)

Important Before downloading your Easysoft ODBC driver, please refer to these notes:

IssueNotes
64-bit UniVerse 1164-bit versions of UniVerse 11 need a 64-bit ODBC driver that is built with 64-bit SQLLEN/SQLULEN types. The SQL Server ODBC driver and Oracle ODBC driver that are available on the Easysoft web site are built with 64-bit SQLLEN/SQLULEN types and are therefore compatible with UniVerse 11.
64-bit UniVerse 10 and earlier64-bit versions of UniVerse 10 and earlier need a 64-bit ODBC driver that is built with 32-bit SQLLEN/SQLULEN types. The SQL Server ODBC driver and Oracle ODBC driver that are available on the Easysoft web site are built with 64-bit SQLLEN/SQLULEN types. If you are using a 64-bit version of UniVerse, you need to contact the Easysoft support team () for a 32-bit SQLLEN/SQLULEN ODBC driver. Please supply us with this information:
  • The exact version of UniVerse you are running.
  • The platform you are running UniVerse on.
  • Whether you are connecting to SQL Server or Oracle.
Using the ODBC-ODBC Bridge with UniVerse/UniData on IBM AIXTo use the ODBC-ODBC Bridge (OOB) with UniVerse/UniData on IBM AIX, you need to contact for a 64-bit version of the OOB Client. This version is not currently available on the Easysoft web site.

Install and license the Easysoft ODBC driver on the machine where UniVerse/UniData is installed. For installation instructions, see the documentation for your Easysoft ODBC driver. Refer to the documentation to see which environment variables you need to set.

Configure and Test the ODBC Data Source

  1. Create an Easysoft ODBC driver data source in the /etc/odbc.ini file and test it with unixODBC’s isql command.

    For example, the following Easysoft ODBC-SQL Server Driver data source connects to a remote SQL Server instance:

    [mssql-dsn]
    Driver                  = Easysoft ODBC-SQL Server
    Server                  = my_machine\my_instance
    User                    = my_domain\my_user
    Password                = my_password
    # If the database you want to connect to is the default
    # for the SQL Server login, omit this attribute
    Database                = AdventureWorks
  2. Use isql to test the new data source. For example:
    cd /usr/local/easysoft/unixODBC/bin
    ./isql -v mssql-dsn

    At the prompt, type "help" to display a list of tables. To exit, press return in an empty prompt line.

  3. If your UniVerse/UniData platform is AIX, you need to extract the Driver Manager shared object and set permissions on the top-level easysoft directory:
    cd /usr/local/easysoft/unixODBC/lib
    ar -X32_64 -xv libodbc.a
    mv libodbc.so.1 libodbc.so
    chgrp -R <GRPNAME> /usr/local/easysoft
    chmod -R 77<n> /usr/local/easysoft

    where:

    • <GRPNAME> is one of the groups UniVerse/UniData is a member of.
    • <n> is the required permission at world level, usually 5.

Connect to the ODBC Data Source from the UniVerse SQL Client Interface

  1. Shut down UniVerse.
  2. Run the relink.uvlibs script so that UniVerse uses the unixODBC shared objects:
    cd $uvhome/bin
    relink.uvlibs /usr/local/easysoft/unixODBC/lib
  3. Start UniVerse.
  4. To access an ODBC data source with the CONNECT command (as shown later in this tutorial), you need to add a data source specification to $uvhome/uvodbc.config (this file may also be located in /etc):
    <data_source>
    DBMSTYPE = ODBC

    where data_source is the name of your Easysoft ODBC data source. For example:

    <mssql-dsn>
    DBMSTYPE = ODBC
  5. At the UniVerse prompt, use the CONNECT command to access the ODBC data source:
    cd $uvhome
    uv
    CONNECT data_source

    where data_source is the name of your Easysoft ODBC driver data source. For example:

    CONNECT mssql-dsn
  6. When prompted, type a valid database user name and password.
  7. At the data source prompt, you can execute any valid SQL statement. To exit CONNECT, type .Q.

Connect to the ODBC Data Source from the UniData SQL Client Interface

  1. Run the relink.udlibs script so that UniData uses the unixODBC shared objects:
    cd $udthome/bin
    relink.udlibs /usr/local/easysoft/unixODBC/lib

    Note You do not need to restart UniData to use the new shared objects. However, users currently running a UniData session will continue to use the old shared objects until they exit and reenter their UniData session.

  2. Access the UniData demo account:
    cd $udthome/demo
    udt
  3. At the ECL prompt, use the CONNECT command to access the ODBC data source:
    CONNECT data_source

    where data_source is the name of your Easysoft ODBC driver data source. For example:

    CONNECT mssql-dsn
  4. When prompted, type a valid database user name and password.
  5. At the data source prompt, you can execute any valid SQL statement. To exit CONNECT, type .Q.

Appendix A: Resources

Article Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)