简体   繁体   中英

error of importing data from csv file to IBM netezza sql database

I need to import a csv file (122 GB, all fields are integer or string) to a table on IBM netezza sql database through Aginity Netteza workbench.

I have created the table with fields that names match with ones in the csv file.

When I imported the data I got error:

 Unable to export the data to a file. Error: required option for internal format is not set: Compress

I am confused because I am doing import not export. This is my sql query:

  CREATE TABLE my_table
  (
    id integer ,
    value1 integer ,
    value2 character varying(2) ,
    value3 integer ,
    value4 character varying(32) ,
    value5 integer ,
    value6 double precision
  ); 


   INSERT INTO my_table
   SELECT * FROM 
   EXTERNAL 'E:\\my_path\\my_file.csv'
   USING
   (
      DELIMITER ','
      LOGDIR 'C:\\my_log'
      Y2BASE 2000
      ENCODING 'internal'
      SKIPROWS 1
      REMOTESOURCE 'ODBC'
      ESCAPECHAR '\'
   )

Any help would be appreciated.

thanks

This is a case of misleading error text, I think. If you are importing from a CSV then you should be using Text as the FORMAT. It looks as if it is defaulting to 'internal' which is not what you want. Try adding FORMAT 'text' to the USING section to explicitly state you are working with a text file.

INSERT INTO my_table
   SELECT * FROM 
   EXTERNAL 'E:\\my_path\\my_file.csv'
   USING
   (
      DELIMITER ','
      LOGDIR 'C:\\my_log'
      Y2BASE 2000
      ENCODING 'internal'
      SKIPROWS 1
      REMOTESOURCE 'ODBC'
      ESCAPECHAR '\'
      FORMAT 'text'
   )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM