Accessing ODBC data sources from Rocket Software UniVerse and UniData
Contents
- Introduction
- Configuring and testing the ODBC data source
- Connecting to the ODBC data source from the UniVerse SQL Client Interface
- Connect to the ODBC data source from the UniData SQL Client Interface
- Resources
Introduction
Easysoft ODBC drivers enable the U2 data servers, UniVerse and UniData, to access databases such as SQL Server, Oracle and Access from UNIX and Linux platforms.
Important Before downloading your Easysoft ODBC driver, refer to these notes:
| Issue | Notes | 
|---|---|
| 64-bit UniVerse 11 | 64-bit versions of UniVerse 11 need a 64-bit ODBC driver that is built with 64-bit SQLLENandSQLULENtypes. The SQL Server ODBC driver and Oracle ODBC driver that are available on the Easysoft web site are built with 64-bitSQLLENandSQLULENtypes and are therefore compatible with UniVerse 11. | 
| 64-bit UniVerse 10 and earlier | 64-bit versions of UniVerse 10 and earlier need a 64-bit ODBC driver that's built with 32-bit SQLLENandSQLULENtypes. The SQL Server ODBC driver and Oracle ODBC driver that are available on the Easysoft web site are built with 64-bitSQLLENandSQLULENtypes. If you're using a 64-bit version of UniVerse, you need to contact the Easysoft support team () for a 32-bitSQLLENorSQLULENODBC driver. Supply us with this information:
 | 
Install and license the Easysoft ODBC driver on the machine where UniVerse and UniData are installed. For installation instructions, refer to the documentation for your Easysoft ODBC driver. Refer to the documentation to find out which environment variables you need to set.
Configuring and testing the ODBC data source
- Create an Easysoft ODBC driver data source in the /etc/odbc.inifile and test it with unixODBC's isql command.For example, the following Easysoft SQL Server ODBC 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 
- Use isql to test the new data source. For example:
          cd /usr/local/easysoft/unixODBC/bin ./isql -v mssql-dsn At the prompt, enter helpto display a list of tables. To exit, press Return in an empty prompt line.
- If your UniVerse and 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 77n /usr/local/easysoft where: - GRPNAMEis one of the groups UniVerse or UniData is a member of.
- nis the required permission at world level, usually- 5.
 
Connecting to the ODBC data source from the UniVerse SQL Client Interface
- Shut down UniVerse.
- Run the relink.uvlibsscript so that UniVerse uses the unixODBC shared objects:cd $uvhome/bin relink.uvlibs /usr/local/easysoft/unixODBC/lib 
- Start UniVerse.
- To access an ODBC data source with the CONNECTcommand (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_sourceis the name of your Easysoft ODBC data source. For example:<mssql-dsn> DBMSTYPE = ODBC 
- At the UniVerse prompt, use the CONNECTcommand to access the ODBC data source:cd $uvhome uv CONNECT data_source where data_sourceis the name of your Easysoft ODBC driver data source. For example:CONNECT mssql-dsn 
- When prompted, enter a valid database user name and password.
- At the data source prompt, you can execute any valid SQL statement. To exit CONNECT, enter.Q.
Connect to the ODBC data source from the UniData SQL Client Interface
- Run the relink.udlibsscript 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 continue to use the old shared objects until they exit and re-enter their UniData session. 
- Access the UniData demo account:
          cd $udthome/demo udt 
- At the ECL prompt, use the CONNECTcommand to access the ODBC data source:CONNECT data_source where data_sourceis the name of your Easysoft ODBC driver data source. For example:CONNECT mssql-dsn 
- When prompted, enter a valid database user name and password.
- At the data source prompt, you can execute any valid SQL statement. To exit CONNECT, enter.Q.