BTEQ Import Data file error

General
N/A

BTEQ Import Data file error

Hi Gurus

Iam trying to import datafile into a table using BTEQ import...getting the following error
any help appreciated...
Thanks

*** Starting Row 2 at Wed Mar 24 15:40:18 2010

*** Failure 3706 Syntax error: Column name list longer than value list.
Statement# 1, Info =442

*** Warning: Repeat is cancelled.
*** Finished at input row 4 at Wed Mar 24 15:40:19 2010
*** Total number of statements: 1, Accepted : 0, Rejected : 1

*** Total elapsed time was 1 second.

+---------+---------+---------+---------+---------+---------+---------+----

.logoff
*** You are now logged off from the DBC.
+---------+---------+---------+---------+---------+---------+---------+----
.quit
*** Exiting BTEQ...
*** RC (return code) = 8
Tags (1)
5 REPLIES

Re: BTEQ Import Data file error

What part of "column name list longer than value list" don't you understand? If you still can't find your syntax error, post your insert statement to get more help from this forum.
N/A

Re: BTEQ Import Data file error

HI Jim
Here is my insert statement

USING
EmpNo (Smallint),
Name (Varchar(12)),
DeptNo (Smallint),
JobTitle (Varchar(12)),
Salary (Decimal(8,2)),
YrsExp (Byteint),
DOB (Date),
Sex (Char(1)),
Race (Char(1)),
MStat (Char(1)),
EdLev (Byteint),
HCap (Byteint)

insert into vmtest.emptemp

(
EmpNo,
Name,
DeptNo,
JobTitle,
Salary,
YrsExp,
DOB,
Sex,
Race,
MStat,
EdLev,
HCap)

Values
(:EmpNo,
:Name,
:DeptNo,
:JobTitle,
:Salary,
:YrsExp
:DOB,
:Sex,
:Race,
:MStat,
:EdLev,
:HCap);
N/A

Re: BTEQ Import Data file error

Values
(:EmpNo,
:Name,
:DeptNo,
:JobTitle,
:Salary,
:YrsExp <---- missing comma
:DOB,
:Sex,
:Race,
:MStat,
:EdLev,
:HCap);

Dieter

Re: BTEQ Import Data file error

Hi Dieter,

Above post is pretty old but i am trying to learn from the issue. Could you please guide me by letting me know if we also need to cast our inputs to respective datatypes in above example!!

Also, in what situations can we use datatypes matching our table definition in "using"?

As far as i have seen, there can be either fixed length (char) or variable length (vartext) modes in which files could be imported and using clause within bteq could only use either of these datatypes while parsing records.

N/A

Re: BTEQ Import Data file error

There will be automatic type casts if source and target data types don't match. If the automatic cast fails you must add a manual cast.

Input columns must be defined as Varchars if the record format is set to VARTEXT, i.e. readable data. Otherwise you must use INT, DATE, etc. when you got binary data in your input file.