Open System Services ODBC/MX Client Driver for SQL/MX Release 3.1 (H06.23+, J06.12+)
HP NonStop Open System Services ODBC/MX Client Driver for SQL/MX Release 3.1—663857-001
A-1
A Sample ODBC Application
Compilation and Linking of the Sample ODBC Application
Sample Application compilation step:
Use the c89 compiler to compile the application with the header files that are
shipped along with the OSS ODBC/MX Client Driver:
OSS> c89 -o < output object name> -I/usr/include/odbc/ \
-c < input file for compilation>
By default, the header files are located at the /usr/include/odbc/ directory.
Example A-1. Example for compiling a threaded program
OSS> c89 -g -Winspect -Wextensions -Ww -Woptimize=0 \
-Wsystype=oss -Wrefalign=8 -Wfieldalign=auto \
-Wallow_cplusplus_comments -Wcplusplus -Wversion3 \
-Wtarget=tns/e -DYOSEMITE -Wcall_shared -DVERSION3 \
-D__GNUC__ -DOSS_DRIVER -D_DEBUG -DNSK_PLATFORM \
-DTCL_MEM_DEBUG -D__TANDEM -Dset_fieldalign \
-D_TNS_R_TARGET -WIEEE_float -I/usr/include/odbc \
-c ThreadODBCTestAppl.c -o ThreadODBCTestAppl.o
Sample Application linking step:
Use the eld linker to link the application with the OSS ODBC/MX Client Driver
(ZODBCDLL). By default, the driver is located at the $SYSTEM.ZMXODBC location.
Example A-2. Example for linking a threaded program
OSS> eld -o ThreadODBCTestAppl -verbose -Bdynamic \
-set systype oss -set FLOATTYPE IEEE_FLOAT -call_shared \
-set highpin on -set highrequestor on \
-lcpp3 -lcppc -lcrtl -lcre -linet -lzsptdll \
-l<Location of zodbcdll>/zodbcdll /usr/lib/ccplmain.o
ThreadODBCTestAppl.o
Execution and Testing of Sample ODBC Application
To run the sample test application, issue any of the following commands on the OSS
shell:
OSS> ./ODBCTest <DS Name>
OSS> ./ODBCTest –help
Considerations:
Note. For C programming applications, add -Wallow_cplusplus_comments flag in the
compile step.










