如何对只有一列且“n”的文件执行快速加载行?

发布于 2024-10-05 19:11:20 字数 850 浏览 7 评论 0原文

我已经对具有多个列的表进行了快速加载(我使用 vartext 格式以 , 作为分隔符进行了此操作)。

现在我想加载一个只有一列(还有 5 行)的文件。但我无法做到这一点并遇到以下错误:

I/O Error on File Read: 16, Text: Unexpected data format

我的快速加载脚本如下:

SESSIONS 5;

.LOGON dbc/dbc.dbc;
BEGIN LOADING MYTABLE
ERRORFILES
TABLE_FLET,
TABLE_FLUV ;

DEFINE
COL1_MYTABLE (CHAR(2))
FILE = C:\Fload\INPT.TXT;

INSERT INTO MYTABLE
(
COL1_MYTABLE
)
VALUES
(
:COL1_MYTABLE
);

END LOADING;

MyTable 结构如下:

CREATE MULTISET TABLE database.MYTABLE ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT
     (
      COL1_MYTABLE CHAR(2) CHARACTER SET LATIN NOT CASESPECIFIC
      )
      PRIMARY INDEX ( COL1_MYTABLE );

输入文件的内容如下:

AA
BB
CC
DD  
EE

我怎样才能进行此快速加载?

I have done fastload for table which has more than one column (I did this with vartext format with , as delimiter).

Now I want to load a file which has only one column (and 5 rows to say). But I'm unable to do that and encountering the below error:

I/O Error on File Read: 16, Text: Unexpected data format

My fastload script is as below:

SESSIONS 5;

.LOGON dbc/dbc.dbc;
BEGIN LOADING MYTABLE
ERRORFILES
TABLE_FLET,
TABLE_FLUV ;

DEFINE
COL1_MYTABLE (CHAR(2))
FILE = C:\Fload\INPT.TXT;

INSERT INTO MYTABLE
(
COL1_MYTABLE
)
VALUES
(
:COL1_MYTABLE
);

END LOADING;

MyTable structure is as below:

CREATE MULTISET TABLE database.MYTABLE ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT
     (
      COL1_MYTABLE CHAR(2) CHARACTER SET LATIN NOT CASESPECIFIC
      )
      PRIMARY INDEX ( COL1_MYTABLE );

the contents of the input file is as below:

AA
BB
CC
DD  
EE

How can I do this fastload?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回心转意 2024-10-12 19:11:20

完成..使用以下脚本:

.LOGON DBC/DBC,DBC;

CREATE MULTISET TABLE DATABASE.MYTABLE ,NO FALLBACK ,  
     NO BEFORE JOURNAL,  
     NO AFTER JOURNAL,  
     CHECKSUM = DEFAULT  
     (  
      COL1_MYTABLE CHAR(2) CHARACTER SET LATIN NOT CASESPECIFIC)  
PRIMARY INDEX ( COL1_MYTABLE );  


BEGIN LOADING MYTABLE  
ERRORFILES  
        TABLE_FLET,  
        TABLE_FLUV  
;  

<b>SET RECORD TEXT;  </b>  
DEFINE  
COL1_MYTABLE (CHAR(2))  
FILE = C:\Fload\INPT.TXT;  

SHOW;  
INSERT INTO MYTABLE  
(  
COL1_MYTABLE  
)  
VALUES  
(  
:COL1_MYTABLE  
);  

END LOADING;

Done.. with the below script :

.LOGON DBC/DBC,DBC;

CREATE MULTISET TABLE DATABASE.MYTABLE ,NO FALLBACK ,  
     NO BEFORE JOURNAL,  
     NO AFTER JOURNAL,  
     CHECKSUM = DEFAULT  
     (  
      COL1_MYTABLE CHAR(2) CHARACTER SET LATIN NOT CASESPECIFIC)  
PRIMARY INDEX ( COL1_MYTABLE );  


BEGIN LOADING MYTABLE  
ERRORFILES  
        TABLE_FLET,  
        TABLE_FLUV  
;  

<b>SET RECORD TEXT;  </b>  
DEFINE  
COL1_MYTABLE (CHAR(2))  
FILE = C:\Fload\INPT.TXT;  

SHOW;  
INSERT INTO MYTABLE  
(  
COL1_MYTABLE  
)  
VALUES  
(  
:COL1_MYTABLE  
);  

END LOADING;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文