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

Tools
Enthusiast

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

While using BTEQ IMPORT I am getting the following error. I know that this is due to a data item not matching the definition, i.e. definition set to VARCHAR(5) and data item being 6 charaters.

What I would like to know is how to halt the code and exit with an error code. The objective being to stop the code from processing any more records as soon as an error code occurs. At the momment it carries on to process all the records: -

.SET ERROROUT STDOUT
.SET QUIET ON

DROP TABLE BUSINESS_SECTOR_TEAMS;

CREATE TABLE BUSINESS_SECTOR_TEAMS
(
REGION INTEGER COMPRESS
,TEAM VARCHAR(60)
,TEAM_ABR VARCHAR(6)
,TEAM_ID INTEGER NOT NULL
,GROUP_ID INTEGER COMPRESS
,GROUP_NAME VARCHAR(50)
)
UNIQUE PRIMARY INDEX (TEAM_ID);

.if errorcode <> 0 then .quit errorcode

.IMPORT VARTEXT '|' FILE=f:\DATA\TD_automation\DATA\1155.tdd

.if errorcode <> 0 then .quit errorcode

.REPEAT*

.if errorcode <> 0 then .quit errorcode

USING (C1 VARCHAR(5)
,C2 VARCHAR(60)
,C3 VARCHAR(6)
,C4 VARCHAR(6)
,C5 VARCHAR(5)
,C6 VARCHAR(50))

INSERT INTO BUSINESS_SECTOR_TEAMS
(REGION
,TEAM
,TEAM_ABR
,TEAM_ID
,GROUP_ID
,GROUP_NAME)
VALUES (:C1
,:C2
,:C3
,:C4
,:C5
,:C6)
;

.if errorcode <> 0 then .quit errorcode

1 REPLY
Teradata Employee

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

try .SET REPEATSTOP ON