简体   繁体   English

将CSV文件中的数据导入IBM Netezza SQL数据库时出错

[英]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. 我需要通过Aginity Netteza工作台将csv文件(122 GB,所有字段均为整数或字符串)导入IBM netezza sql数据库上的表。

I have created the table with fields that names match with ones in the csv file. 我用名称与csv文件中的名称匹配的字段创建了表。

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: 这是我的SQL查询:

  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. 如果要从CSV导入,则应使用“文本”作为“格式”。 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. 尝试将FORMAT'text'添加到USING部分,以明确声明您正在使用文本文件。

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'
   )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将数据从txt文件导入IBM netezza SQL数据库时出错 - error of importing data from txt file to IBM netezza SQL database 如果从Aginity工作台将47G数据文件导入到IBM netezza数据库,则会发生错误 - error if importing a 47G data file to IBM netezza database from Aginity workbench 在Win 7上从IBM netezza数据库导出sql数据表到txt文件的错误 - error of exporting a sql data table from IBM netezza database to a txt file on win 7 Win7上Aginity工作台在IBM netezza SQL数据库上执行SQL查询时出错 - Error of SQL query on IBM netezza SQL database from Aginity workbench on Win7 IBM netezza SQL数据库中运行存储过程的错误 - error of running a stored proceudre in IBM netezza SQL database SQL SERVER,从CSV文件导入。 数据转换错误 - SQL SERVER, importing from CSV file. Data conversion error 将数据从XML文件导入SQL数据库 - Importing data from XML file to SQL database 在win 7上从Aginity工作台找到IBM netezza sql数据库上的表大小 - find the table size on IBM netezza sql database from Aginity workbench on win 7 将SQL数据库从一台服务器复制到IBM netezza Aginity工作台上的另一台服务器 - copy a SQL database from one server to another server on IBM netezza Aginity workbench 从Visual Studio 2012访问Netezza SQL数据库的错误 - an error of accessing Netezza SQL database from Visual Studio 2012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM