Help required BTEQ IMPORT

Tools

Help required BTEQ IMPORT

Hi
i am trying to import a file using BTEQ here are the file details and script. when i try to import it is giving error.

params.txt
1

script.
.LOGON demotdat/dbc,123;
.import data file=params.txt;
using eno(char(1)) sel * from smk.emp where emp_no=:eno;
.LOGOFF;
.QUIT;

error
*** Growing Buffer to 3377
*** Error: Import data size does not agree with byte length.
The cause may be:
1) IMPORT DATA vs. IMPORT REPORT
2) incorrect incoming data
3) import file has reached end-of-file.
*** Warning: Out of data.

can iknow what should be the reason for this.

Thanks
4 REPLIES
Enthusiast

Re: Help required BTEQ IMPORT

Hi Musomasu,
try defining fornmat for you input file....

if I were you I would define format vartext and declare eno variable as VARCHAR(1).

Hope this helps,
Bye,
TDUser

Re: Help required BTEQ IMPORT

Hi
i Tried with vartext and worked fine.

params.txt
1

script.
.LOGON demotdat/dbc,123;
.import vartext file=params.txt;
using eno(varchar(1)) sel * from abc.emp where emp_no=:eno;
.LOGOFF;
.QUIT;

can we use the variable eno in more than one query.

i mean

.LOGON demotdat/dbc,123;
.import vartext file=params.txt;
using eno(varchar(1)) sel * from abc.emp where emp_no=:eno;
using eno(varchar(1)) sel * from abc.manager where emp_no=:eno;
.LOGOFF;
.QUIT;

when i use the second query it is giving error.

can anybody let me know how to rectify this issue.is there any alternate way to do this.

Thanks
Senior Apprentice

Re: Help required BTEQ IMPORT

Hi Musomasu
just use a multistatement:

.LOGON demotdat/dbc,123;
.import vartext file=params.txt;
using eno(varchar(1)) sel * from abc.emp where emp_no=:eno
;using eno(varchar(1)) sel * from abc.manager where emp_no=:eno;
.LOGOFF;
.QUIT;

Dieter

Re: Help required BTEQ IMPORT

Hi Deiter

Thanks for the Help,it works fine.

thanks