The nzodbcsql command allows users to test the settings and configuration of the Netezza® ODBC driver to identify any problem settings in the odbcinst.ini and odbc.ini files.
The nzodbcsql command is a troubleshooting tool for testing the ODBC UNIX clients. The command is included in the bin directory of the IBM® Netezza CLI client kits for Linux, Solaris, HP, and AIX®.
When you run the command, the command displays some basic help and a summary of the driver and IBM Netezza versions. You must specify the name of the IBM Netezza DSN, and you can include options to limit the number of result rows for testing purposes. For example:
[nz@nzhost ~]$ /usr/local/nz/bin64/nzodbcsql NZSQL
NZODBCSQL - program to test Netezza ODBC driver
Usage : <exe> <DSN> [Max-rows]
1 - Data Source Name - mandatory
2 - Maximum rows to display - optional; default 100
Type 'quit' or '\q' or CTRL-D or ENTER at the prompt to quit
NOTE: Max 100 rows are displayed (for selects)
Driver version : 'Release 6.0 [Build 14432]'
NPS version : '06.00.0000 Release 6.0 [Build 14432]'
Database : 'system'
nzodbc >
At the nzodbc> prompt, users can enter any SQL query to test the database connection. For example:
nzodbc > select R_Name from region;
R_NAME
---------------------------
AMERICA
AFRICA
EUROPE
ASIA
MIDDLE EAST
Rows Returned : 5
If your user data contains special characters or language forms, make sure that the LANG environment variable is set correctly. If the LANG value is incorrect, the nzodbcsql output shows a question mark character (?) for characters that it cannot interpret. For example:
nzodbc > select * from city_test;
CITY
----------------------
Montr?al
Montr?al
Montr?al
Rows Returned : 3
If LANG is set correctly, the accented character prints correctly. For example:
[nz@nzhost ~]$ export LANG=en_US
[nz@nzhost ~]$ ./nzodbcsql NZSQL
NZODBCSQL - program to test Netezza ODBC driver
...
nzodbc > select * from city_test;
CITY
----------------------
Montréal
Montréal
Montréal
Rows Returned : 3
The nzodbcsql command is intended for testing connectivity and settings for the odbc.ini and network settings. Do not use the tool as a database interface to retrieve or insert large amounts of data.