1

I have recently installed IBM's Netezza Linux ODBC driver onto my web server. We have it all set up and are running queries through isql with the hopes to integrate it to a php website.

The issue we are having has to do with the return set. I only get the first field of the first result row. This occurs even though the output of the sql command returns the correct number of rows. I have tried running the sql through the command line as well as outputting the results to a file but it made no difference.

Example

-bash-3.2$ isql NZSQL -m10 -v
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select objid, tablename, owner from _v_table limit 10
+-----------+-----------+-----------+
| objid     | tablename | owner     |
+-----------+-----------+-----------+
| 19198083  |
|
|
|
|
|    
|
|
|
|
+-----------+-----------+-----------+
SQLRowCount returns 10
10 rows fetched

Here are my versions

unixODBC

-bash-3.2$ isql --help
unixODBC 2.2.11

OS

-bash-3.2$ uname -rvpo
2.6.18-274.7.1.el5 #1 SMP Mon Oct 17 11:57:14 EDT 2011 x86_64 GNU/Linux

any ideas would be greatly appreciated.

powpow12
  • 587
  • 8
  • 13
  • Is there any reason why you use isql instead of Netezza's native nzsql client? – Alex Vorobiev Jun 20 '13 at 14:38
  • I am familiar with the NZSQL client on the Netezza appliance, but I am not sure if the unix/linux installation .tar came with the client. The installation of unix/linux odbc onto our web servers was managed by our linux team but I do not remember seeing the client when I navigated through the downloaded files. – powpow12 Jun 20 '13 at 14:54
  • Check your $NZ_HOME/bin directory, nzsql should be there. $NZ_HOME should be something like /usr/local/nz. – Alex Vorobiev Jun 20 '13 at 15:40
  • I recommend turning on ODBC logging (add `Trace = yes` and `TraceFile = /tmp/odbc.log` to your odbcinst.ini file). I bet there's an error. – Benny Hill Jun 20 '13 at 16:39
  • @BennyHill netezza odbc comes with `DebugLogging` and `LogPath` when I populated these values no log file was created. I then edited the file and changed them to what you suggested but no change occured. – powpow12 Jun 20 '13 at 18:59
  • @AlexVorobiev you were correct the directories are there. I tried running an nzsql command but got the following error: `nzsql: error while loading shared libraries: libssl.so.4: cannot open shared object file: No such file or directory` – powpow12 Jun 20 '13 at 18:59
  • @BennyHill It worked with `DebugLoggin = 1 LogPath = /tmp`, the log is quite large and I can't seem to find the smoking gun. Is there something I am looking for? – powpow12 Jun 20 '13 at 19:22
  • libssl has to be present on your linux system, check /lib directory. Back to your original question, do you actually see it stop after objid and prior to printing the table name? If so, I'd say check if there are tables with non-ascii characters in their names and/or repeat the query with added "WHERE objid <> 19198083". – Alex Vorobiev Jun 20 '13 at 19:59
  • In the odbc.log search for the string `error` and/or `SQL_ERROR`. – Benny Hill Jun 20 '13 at 21:29
  • @BennyHill there is no mention of an error, I did find one failure during the connection portion but it seemed to fix itself `Sock_connect_to: connect failed; return = -1, errno = 115 Conn_open_socket: connection to the server socket succeeded.` – powpow12 Jun 21 '13 at 12:24
  • I'm out of ideas :-( My thought was similar to Alex's - I thought there was some kind of problem with data in the database but if you're not seeing any errors in the log I don't think that's the problem. Sorry I couldn't be of more help. – Benny Hill Jun 21 '13 at 12:57
  • @BennyHill thank you for taking the time, I am still working on two other fronts: getting `nzsql` to work and trying `odbc_connect` through php. I am hoping that when I pull results through these query tools I will get past this 1 record of the 1st row issue. – powpow12 Jun 24 '13 at 12:31
  • I was able to connect via nzsql and my result set returned as expected (fully populated and view-able). Still working on php. – powpow12 Jun 27 '13 at 15:32

0 Answers0