create external table with headers in netezza (postgres)

Nikhil Das Nomula picture Nikhil Das Nomula · Apr 30, 2013 · Viewed 14.9k times · Source

I am creating an external table as shown below

CREATE EXTERNAL TABLE '~\test.csv' 
USING ( DELIMITER ',' Y2BASE 2000 ENCODING 'internal' REMOTESOURCE 'ODBC' ESCAPECHAR '\' )
AS SELECT * FROM TEST_TABLE;

It works fine. My question is :

Is there a way we can name the header values as column names in the test.csv file ? Is it possible in either Netezza or postgres.

I think we can do it using COPY, however I want to do it using the EXTERNAL TABLE command.

Thanks

Answer

ScottMcG picture ScottMcG · Nov 19, 2014

In version 7.2 of Netezza you can now specify the IncludeHeader option to achieve this with external tables.

This is documented here