nzodbcsql command

You can use the nzodbcsql command to test the settings and configuration of the IBM® 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 UNIXand Linux® clients. The command is included in the bin directory of the Netezza CLI client kits for Linux, Solaris, HP, and AIX® operating systems.

When you run the command, it displays some basic help and a summary of the driver and Netezza versions. You must specify the name of the Netezza DSN, and you can include options to limit the number of result rows for testing purposes. An example follows:

[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, you can enter any SQL query to test the database connection. An example follows:

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 you set the LANG environment variable correctly. If the value of the LANG environment variable is incorrect, the nzodbcsql command output shows a question mark character (?) for characters that it cannot interpret. An example follows:

nzodbc > select * from city_test;

         CITY
----------------------
 Montr?al
 Montr?al
 Montr?al

Rows Returned : 3

If you set the LANG environment variable correctly, the accented character prints correctly. An example follows:

[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, settings for the odbc.ini and odbcinst.ini files, and network settings. Do not use the command as a database interface to retrieve or insert large amounts of data.