Fastload Error with Decimal: 2679

3k Views Asked by At

I'm trying to fastload some data. The second column should be treated as a decimal, however I keep getting 2679 bad character errors when I try to load the data. Any suggestions as to what is going on?

#data
29499512266332107004116346230154901061,22.40
79270112045695798581952128836258811725,2.31
79270112045695798581952128836258811725,0.47
79270112045695798581952128836258811725,3.10
79270112045695798581952128836258811725,1.14


#fastload 
sessions 16;
SLEEP 10;
TENACITY 2;

.LOGON s/u,p;

DROP TABLE db.table;
DROP TABLE db.table_ERR1;
DROP TABLE db.table_ERR2;


create table db.table(
    id varchar(100),
    tos dec(7,2)) no primary index;


BEGIN LOADING
   db.table
    ERRORFILES
     db.table_ERR1,
     db.table_ERR2
     CHECKPOINT 500000 ;

SET record vartext "," NOSTOP;

DEFINE
id (varchar(100)),
tos (VARCHAR(15))


 FILE=  upload.txt;

INSERT INTO db.table
VALUES
(
:id,
:tos
);


END LOADING;
LOGOFF;
.QUIT;
2

There are 2 best solutions below

0
On

You might have to try teradata style typecast in the insert values as mentioned by andrew.

0
On

In your Fastload you are defining second column as varchar. U want to insert decimal values in tos but in DEFINE you declare it as varchar. So change it to decimal and then try to execute it.