CREATE WRAPPER statement - Examples for the ODBC wrapper

Use the CREATE WRAPPER statement to register the ODBC wrapper. This topic provides examples for Linux, UNIX and Windows.

In the following examples, odbc_wrapper is the name that you assign to the wrapper that you are registering in the federated database.

Linux and Solaris federated server

The following example shows you how to register a wrapper with the default name on a federated server that runs Linux or Solaris:
CREATE WRAPPER odbc OPTIONS (MODULE '/opt/lib/odbc.so');

You must specify the MODULE wrapper option on federated servers that run Linux or UNIX. The MODULE wrapper option specifies the full path of the library that contains the ODBC Driver Manager.

The following example shows you how to register a wrapper with an alternative name on a federated server the runs Linux or Solaris:
CREATE WRAPPER odbc_wrapper LIBRARY 'libdb2rcodbc.so' 
     OPTIONS (MODULE '/opt/lib/odbc.so');

AIX federated server

The following example shows you how to register a wrapper with the default name on a federated server that runs AIX®:
CREATE WRAPPER odbc 
     OPTIONS (MODULE '/usr/lib/odbc.a'); 

You must specify the MODULE wrapper option on federated servers that run UNIX. The MODULE wrapper option specifies the full path of the library that contains the ODBC Driver Manager.

The following example shows you how to register a wrapper with an alternative name on a federated server that runs AIX:
CREATE WRAPPER odbc_wrapper LIBRARY 'libdb2rcodbc.a' 
     OPTIONS (MODULE '/usr/lib/odbc.a');

IBM WebSphere Classic Federation Server for z/OS (AIX)

The following example shows you how to register an ODBC wrapper by issuing the CREATE WRAPPER statement on an AIX operating system. For 64-bit AIX and Solaris, if you use a IBM® WebSphere® Classic Federation Server for z/OS® client, the DB2_FENCED and DB2_SOURCE_CLIENT_MODE options must be specified as shown in the following example.
CREATE WRAPPER odbc  
		OPTIONS (DB2_FENCED 'Y', DB2_SOURCE_CLIENT_MODE '32BIT', 
		MODULE '/opt/IBM/DB2IIClassic82/cli/lib/cacsqlcli.so');
The DB2_SOURCE_CLIENT_MODE is supported on AIX and Solaris only.

You must specify the MODULE wrapper option on federated servers that run UNIX. The MODULE wrapper option specifies the full path of the library that contains the ODBC Driver Manager.

The following example shows you how to register a wrapper for accessing IBM WebSphere Classic Federation Server for z/OS data sources with an alternative name:
CREATE WRAPPER odbc_wrapper LIBRARY 'libdb2rcodbc.a'
		OPTIONS (DB2_FENCED 'Y', DB2_SOURCE_CLIENT_MODE '32BIT', 
		MODULE '/opt/IBM/DB2IIClassic82/cli/lib/cacsqlcli.so');

Windows federated server

The following example shows you how to register a wrapper with the default name on a federated server that runs Windows:
CREATE WRAPPER odbc; 
The following example shows you how to register a wrapper with an alternative name on a federated server that runs Windows:
CREATE WRAPPER odbc_wrapper LIBRARY 'db2rcodbc.dll';