Search code examples
sqlodbctemp-tablesnetezzaimport-from-excel

Aginity for Netezza Create Temp Table from external xlsx file using ODBC


In Aginity Workbench for Netezza, I am trying to create a temp table from a .XLSX file containing 13 columns but only need columns 1 and 5. I can export to tab delimited .TXT with only the two columns needed and it works fine, but I would like to avoid converting from the original file as it is regularly updated and others may be running this file. Must be TEMP TABLE and must be XLSX. The temp table will JOINed in a subsequent query.

I have the following query:

CREATE TEMP TABLE office AS
(SELECT zip_code, DISPATCH_LEVEL
FROM EXTERNAL 'file.xlsx'
        (zip_code VARCHAR(10), DISPATCH_LEVEL VARCHAR(100))
        USING (REMOTESOURCE 'ODBC' DELIMITER '\t'));

I get the following error block:

ERROR [HY008] Operation canceled
ERROR [01000] Unable to write nzlog/bad files
ERROR [01000] Unable to write nzlog/bad files
ERROR [HY000] ERROR: External Table : count of bad input rows reached maxerrors limit


Solution

  • Netezza external tables simply do not directly support XLSX files. They require character delimited files, fixed length files, or internal/native format files.