简体   繁体   English

Netezza 将 csv 导入为空表

[英]Netezza imports csv as an empty table

I am importing a CSV file into Netezza using the INSERT INTO command:我正在使用 INSERT INTO 命令将 CSV 文件导入 Netezza:

INSERT INTO MY_TABLE
    SELECT
        *
    FROM EXTERNAL 'C:\\file.csv'
    USING (
        REMOTESOURCE 'ODBC'
        DELIMITER ','
        MAXERRORS 100000
        SKIPROWS 1
        ESCAPECHAR '\'
    )
;

Netezza "succesfully" finishes the task, ie no mistakes come up. Netezza“成功”完成了任务,即没有出现错误。 However, the data is not imported at all.但是,根本不会导入数据。 Out of 1000 rows, only 100 are imported and none of them contain anything.在 1000 行中,只有 100 行被导入并且它们都不包含任何内容。

I followed the code found in Netezza CSV load我按照在Netezza CSV 加载中找到的代码进行操作

I have also tried to import the data via the external table and it failed again in the same manner.我还尝试通过外部表导入数据,但它以同样的方式再次失败。

Am I missing something, for example some crucial parameter?我是否遗漏了什么,例如一些关键参数? This procedure has worked without problems before.这个过程以前没有问题。 I don't think there is anything wrong with the csv file I'm trying to import.我认为我尝试导入的 csv 文件没有任何问题。

Based on the link you provided I see two parameters that may be required.根据您提供的链接,我看到了可能需要的两个参数。 Also a slight format change that may make a difference.还有可能会有所不同的轻微格式更改。

INSERT INTO MY_TABLE
SELECT * FROM 
EXTERNAL 'C:\\file.csv'
USING 
(
    DELIMITER ','
    MAXERRORS 100000
    SKIPROWS 1
    Y2BASE 2000
    ENCODING 'internal'
    REMOTESOURCE 'ODBC'
    ESCAPECHAR '\'
    QUOTEDVALUE 'DOUBLE'
)

IBM also has a Data Loading Guide that can be found here . IBM 还提供了一份数据加载指南,可在此处找到。

I finally found out the issue, it is explained in more detail in this thread:我终于发现了这个问题,在这个线程中有更详细的解释:

loading files with dates into netezza 将带有日期的文件加载到 netezza 中

The problem was with importing Date formats.问题在于导入日期格式。 The following two lines needed to be specified in the code:需要在代码中指定以下两行:

DATESTYLE 'DMY'日期风格“DMY”

DATEDELIM '.' DATEDELIM '.'

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

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