Search code examples
powershellexport-to-csvnetezza

Can I export the SQL query results from Netezza?


We want to run a query in the Netezza IDE and export the results in the form of a CSV file. Is there any API which would let us do the same, using a shell or some other script?

Is there any shell available with Netezza which anyone knows about, using which I can run an SQL query and get the results in a text file or a CSV file (preferred)?


Solution

  • Since you have powershell among your tags, I am assuming you need a tool that works under Windows. The command line client for Netezza - nzsql - is not available for Windows but there is a couple of third-party command line sql clients/shells which you can use with with Netezza:

    • jisql, JDBC client; the parameters are the same as in SQuirreL
    • dbish, a perl-based ODBC client; if your ODBC DSN is called NZ, the command line would be

    dbish dbi:ODBC:NZ user password

    Both tools have options to output results as CSV files.