IBM Support

How to query SAP ABAP using Db2 Federation through ODBC driver?

Question & Answer


Question

How to query SAP ABAP using Db2 Federation through ODBC driver?

Answer

Before You Begin
 
Enable Federation feature and restart Db2 to make it effective.
$ db2 update dbm cfg using federated YES
Pre-Configuration on Linux or Unix

  1. You need to download the ODBC driver for SAP ABAP by following the steps in the SAP official site.
    Put it in the path ~/sqllib/federation/odbc/lib.
    ls ~/sqllib/federation/odbc/lib/ODBC_driver_for_ABAP.so
  2. Make sure the data source is accessible to Federation server.
    $ telnet munch1.fyre.ibm.com 443
    Trying 9.30.100.76...
    Connected to munch1.fyre.ibm.com.
    Escape character is '^]'.
    
  3. Create the server, wrapper, user mapping, and nickname and then query the nickname.
    $ CREATE WRAPPER odbc options(DB2_FENCED 'Y', module '~/sqllib/federation/odbc/lib/libodbc.so')
    
    $ CREATE SERVER server1 TYPE SAP_ABAP VERSION 1 WRAPPER odbc OPTIONS (HOST ' munch1.fyre.ibm.com, PORT '443', codepage '1252')
    
    $ CREATE USER MAPPING FOR PUBLIC SERVER SERVER1 OPTIONS( REMOTE_AUTHID '<user>', REMOTE_PASSWORD '<password>’)
    
    
    $ CREATE NICKNAME nk_customer for server1."<schema> "."CUSTOMER"
    
    $ select count(*) from nk_customer
    
    1
    -----------
        1500000
    
      1 record(s) selected.
    





[{"Type":"MASTER","Line of Business":{"code":"","label":""},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCAVPX","label":"Federated Server"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

More support for:
Federated Server

Software version:
All Versions

Document number:
7173955

Modified date:
23 October 2024

UID

ibm17173955

Manage My Notification Subscriptions