Eric
Eric

Reputation: 23

Netezza import from external file error: Unsupported external table reference, unable to derive shape

I'm working to create a new table from an external file in Netezza, but am getting the following error:

Unsupported external table reference, unable to derive shape

I get the same error whether trying to create a new table or insert into an existing table. Here is the sql I'm using:

            select * from external 'FILEPATH.txt' using (delim '|');


Upvotes: 2

Views: 681

Answers (1)

Mike DeRoy
Mike DeRoy

Reputation: 143

you need to define the column format in your query. then the query will fire

SYSTEM.ADMIN(ADMIN)=> select * from external '/tmp/testfile.txt' (v1 int, v2 int) using (delim '|');
 V1 | V2 
----+----
  3 |  4
  3 |  6
(2 rows)

note that when inserting into an existing table you don't need to specify the types

SYSTEM.ADMIN(ADMIN)=> create table test (v1 int, v2 int);
CREATE TABLE
SYSTEM.ADMIN(ADMIN)=> insert into test select * from external '/tmp/testfile.txt' using (delim '|');
INSERT 0 2

Upvotes: 2

Related Questions