Getting a Error in BTEQ Import

Teradata Applications
Enthusiast

Getting a Error in BTEQ Import

Hi Guys,

Below is the code i trying to run to import data throught BTEQ import

.logon home/jbhatt,jugal

.import vartext ',' file=/home/jbhatt/insert.txt

.quiet on

.repeat*

using

f1 (VARCHAR(40)),

f2 (VARCHAR(40)),

f3 (CHAR(40)),

f4 (CHAR(4)),

f5 (VARCHAR(40)),

f6 (VARCHAR(40)),

f7 (VARCHAR(40)),

f8 (VARCHAR(40)),

f9 (VARCHAR(40)),

f10 (VARCHAR(40)),

f11 (VARCHAR(40)),

f12 (VARCHAR(40)),

f13 (VARCHAR(40)),

f14 (VARCHAR(40)),

f15 (VARCHAR(40)),

f16 (VARCHAR(40)),

f17 (VARCHAR(40)),

f18 (VARCHAR(40))

insert into dbjugal.tbjugal values(:f1,:f2,:f3,:f4,:f5,:f6,:f7,:f8,:f9,:f10,:f11,:f12,:f13,:f14,:f15,:f16,:f17,:f18);

.logoff

.quit

Data i am importing is from a text file(insert.txt). Given below:

5461,1000,null,XXX,3020,12,198.59,1,1,0,198.59,null,null,null,null,978,998,999

When i ran the code i got the below error. Could you plz help me in knowing were i am going wrong

 

*** Failure 2673 The source parcel length does not match data that was defined.

                Statement# 1, Info =5

 *** Total elapsed time was 1 second.

 *** Warning: Out of data.

 *** Finished at input row 1 at Wed Feb  5 11:11:14 2014

 *** Total number of statements: 1,  Accepted : 0,  Rejected : 1

 *** Total elapsed time was 1 second.

 BTEQ -- Enter your SQL request or BTEQ command:

 *** Warning: EOF on INPUT stream.

.logoff

 *** You are now logged off from the DBC.

3 REPLIES
Enthusiast

Re: Getting a Error in BTEQ Import

table created:

CREATE MULTISET TABLE dbjugal.tbjugal ,NO FALLBACK ,

     NO BEFORE JOURNAL,

     NO AFTER JOURNAL,

     CHECKSUM = DEFAULT,

     DEFAULT MERGEBLOCKRATIO

     (

      f1 BIGINT NOT NULL,

      f2 INTEGER NOT NULL,

      f3 CHAR(40) CHARACTER,

      f4 CHAR(4) CHARACTER ,

      f5 INTEGER NOT NULL ,

      f6 BYTEINT ,

      f7 DECIMAL(15,2) ,

      f8 INTEGER ,

      f9 INTEGER ,

      f10 INTEGER ,

      f11 DECIMAL(15,2),

      f12 DECIMAL(15,2),

      f13 INTEGER ,

      f14 INTEGER ,

      f15 INTEGER ,

      f16 INTEGER ,

      f17 INTEGER ,

      f18 INTEGER

PRIMARY INDEX ( f1,f2 ); 

Re: Getting a Error in BTEQ Import

Hi,

In your insert.txt , check if it contains the columnnames as header.

If yes you may need try skiping them and import.

.import vartext ',' file=/home/jbhatt/insert.txt, skip=1

Thanks,

Prasanna

Enthusiast

Re: Getting a Error in BTEQ Import

In the using clause why f3 and f4 are defined as char (40). Can you try making them varchar(40) .