开发者

How can I perform fastload for a file which has only one column and 'n' rows?

开发者 https://www.devze.com 2023-01-28 00:27 出处:网络
I have done fastload for table which has more than one column (I did this with vartext format with , as delimiter).

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 开发者_如何学Pythonbelow:

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?


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;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号