This section provides examples for using DataDirect ODBC on UNIX systems:
The examples apply specifically to HP-UX and can be customized for other UNIX systems.
Please note that some versions of DataDirect ODBC may issue the following warning when connected:
[ODBC SQL Server driver] Error on input or output to a file. No such file or directory. Additional Information /opt/odbc/odbc.ini.
To bypass this error message, set the following environment variables on the server side before starting the DataDirect ODBC server:
VORTEX_HOST_LOGFILE=/tmp/host VORTEX_HOST_LOGOPTS=FULL export VORTEX_HOST_LOGFILE VORTEX_HOST_LOGOPTS
$ chatr +s enable osxhost.odbcint osxhost.odbcint: current values: shared executable shared library dynamic path search: SHLIB_PATH disabled second embedded path disabled first Not Defined internal name: osxhost.odbcint shared library list: dynamic /opt/odbc/lib/libodbc.sl dynamic /opt/odbc/lib/libodbcinst.sl dynamic /usr/lib/libC.1 dynamic /usr/lib/libM.1 dynamic /usr/lib/libdld.1 dynamic /usr/lib/libc.1 shared library binding: deferred static branch prediction disabled data page size: 4K instruction page size: 4K new values: shared executable shared library dynamic path search: SHLIB_PATH enabled second embedded path disabled first Not Defined internal name: osxhost.odbcint shared library list: dynamic /opt/odbc/lib/libodbc.sl dynamic /opt/odbc/lib/libodbcinst.sl dynamic /usr/lib/libC.1 dynamic /usr/lib/libM.1 dynamic /usr/lib/libdld.1 dynamic /usr/lib/libc.1 shared library binding: deferred static branch prediction disabled data page size: 4K instruction page size: 4K $
$ chatr +s enable natural natural: current values: shared executable shared library dynamic path search: SHLIB_PATH disabled second embedded path disabled first Not Defined internal name: natural shared library list: dynamic /opt/odbc/lib/libodbc.sl dynamic /opt/odbc/lib/libodbcinst.sl dynamic /usr/lib/libC.1 dynamic /usr/lib/libM.1 dynamic /usr/lib/libdld.1 dynamic /usr/lib/libc.1 shared library binding: deferred static branch prediction disabled data page size: 4K instruction page size: 4K new values: shared executable shared library dynamic path search: SHLIB_PATH enabled second embedded path disabled first Not Defined internal name: natural shared library list: dynamic /opt/odbc/lib/libodbc.sl dynamic /opt/odbc/lib/libodbcinst.sl dynamic /usr/lib/libC.1 dynamic /usr/lib/libM.1 dynamic /usr/lib/libdld.1 dynamic /usr/lib/libc.1 shared library binding: deferred static branch prediction disabled data page size: 4K instruction page size: 4K $
[ODBC Data Sources] myds= Oracle7= dBase= Sybase= Informix= DB2= Text=
[dBase] QEWSD=35691 Driver=/opt/odbc/lib/ivdbf12.sl Description=dBase Database=/opt/odbc/demo
[Sybase] QEWSD=35691 Driver=/opt/odbc/lib/ivsyb12.sl Description=Sybase Database=pubs2 ServerName=SYBASE WorkstationID=id LogonID=sa Password=mypwd OptimizePrepare=2 SelectMethod=1
[Oracle7] Driver=/opt/odbc/lib/ivor712.sl Description=Oracle7 ServerName=usrshp2 LogonID=scott Password=tiger
[Informix] QEWSD=35698 Driver=/opt/odbc/lib/ivinf12.sl Description=informix92 Database=osqdev HostName=usrshp2 LogonID=informix Password=mypwd
[DB2] Driver=/opt/odbc/lib/ivdb212.sl Description=DB2 Database=waHgpo
[Text] Driver=/opt/odbc/lib/ivtxt12.sl Description=Text driver Database=/opt/odbc/demo
[ODBC] Trace=0 TraceFile=odbctrace.out TraceDll=/opt/odbc/lib/odbctrac.sl InstallDir=/opt/odbc
[myds] Driver=/opt/odbc/lib/ivor712.sl Description=Oracle7 ServerName=usrshp2 LogonID=scott Password=tiger
[Infodbc] QEWSD=35698 Driver=/opt/odbc/lib/ivinf12.sl Description=informix92 Database=osqdev HostName=usrshp2 LogonID=informix Password=mypwd
[Sybodbc] QEWSD=35691 Driver=/opt/odbc/lib/ivsyb12.sl Description=Sybase Database=pubs2 ServerName=SYBASE WorkstationID=id LogonID=sa Password=mypwd OptimizePrepare=2 SelectMethod=1
DSQUERY=SYBASE INFORMIXDIR=/opt/odbc IV_GLS_LCDIR=/opt/odbc/gls/lc11 IV_GLS_REGISTRY=/opt/odbc/gls/cm3/registry ODBCHOME=/opt/odbc ODBCINI=/opt/odbc/odbc.ini ODBC_INI=/opt/odbc/odbc.ini PATH=/usr/bin/X11:/bin:/usr/bin:/etc:/usr/etc:/usr/contrib/bin: /users/root:/usr/lib:/usr/lib/acct:/usr/local/bin:.:/SAG/a da/v22313:/SAG/ada/v22313/tools:/SAG/nat/v41219/bin:/SAG/w cp/v2117:/SAG/wcp/v2117/bin:/SAG/osx/v621/bin:/SAG/aad/v12 12/bin:/SAG/esq/v143/tools:.:/SAG/wcp/ ushpux1:/SAG/demoweb/sh:/RDBMS/oracle/app/oracle/orahome/p roduct/9.1/bin:/RDBMS/sybase/bin:/RDBMS/sybase/install:/ RDBMS/sybase/include:/opt/odbc/lib:/opt/odbc/bin:/RDBMS/sy base/lib:/RDBMS/sybase/bin:/usr/lib SHLIB_PATH=/opt/odbc/lib:/RDBMS/sybase/lib:/RDBMS/sybase/bin:/usr/lib SYBASE=/RDBMS/sybase SYBASE_TERM=vt220
INFORMIXDIR=/RDBMS/informix INFORMIXSERVER=learn_online IV_GLS_LCDIR=/opt/odbc/gls/lc11 IV_GLS_REGISTRY=/opt/odbc/gls/cm3/registry ODBCHOME=/opt/odbc ODBCINI=/opt/odbc/odbc.ini ODBC_INI=/opt/odbc/odbc.ini ONCONFIG=onconfig.learn PATH=/usr/bin/X11:/bin:/usr/bin:/etc:/usr/etc:/usr/contrib/bin: /users/root:/usr/lib:/usr/lib/acct:/usr/local/bin:.:/SAG/a da/v22313:/SAG/ada/v22313/tools:/SAG/nat/v41219/bin:/SAG/w cp/v2117:/SAG/wcp/v2117/bin:/SAG/osx/v621/bin:/SAG/aad/v12 12/bin:/SAG/esq/v143/tools:.:/SAG/wcp/ ushpux1:/SAG/demoweb/sh:/opt/odbc/lib:/opt/odbc/bin:/RDBMS /informix/bin SHLIB_PATH=/opt/odbc/lib:/RDBMS/informix/lib:/RDBMS/informix/li b/esql:/RDBMS/informix/bin:/usr/lib TERM=vt100 TERMCAP=/RDBMS/informix/etc/termcap
The current direction chosen for DB2 is to use the IBM DB2 CLI (Call Level Interface).
The following is a sample db2cli.ini
file:
[sample] AUTOCOMMIT=0
[tstcli2x] ; Assuming dbalias2 is a database in DB2 for z/OS. SchemaList="`OWNER1',`OWNER2',CURRENT SQLID"
[MyVeryLongDBALIASName] dbalias=dbalias3 SysSchema=MYSCHEMA
Take special note of the sample database or alias name shown in
the db2cli.ini
file.
If you encounter the following error, add the AUTOCOMMIT=0
specification to the entries for your specific RDBMS.
[IBM] [CLI Driver] [DB2/SUN64] SQL0508N The cursor specified in the UPDATE or DELETE statement is not positioned on a row. SQLSTATE=24504.