Bteq import the output characters got cut off by 2

Database
Enthusiast

Bteq import the output characters got cut off by 2

Can anyone please help?

I have a source text file look like below char(10), 20K count of records,  but the output got only 8 characters and the last two got cut off (i.e. 12345678).

MbrID

1234567890

0123456789

The bteq import code is as below and I can only run it under interactive mode(line by line) because I don't have the access to the TD ETL server, but I can write to data lab. 

how to make it work please?

.logon tdpid/username,password;
.import vartext '' file = C:\Users\myname\Documents\test\T_MbrshipID_Contro.txt
-- ,skip=2 throw out an error. so I comment it out
--Error: the following occurred during an Access Module open:
--Requested file not found.
--importing deactivated.

database DLabc;
.quiet on;
.repeat *;
Using MbrID(char(10))
insert into MbrControl(Mbrship_ID)
values(:MbrID); --mbr is the heading in the txt file
.logoff;
Tags (2)
2 REPLIES
Senior Apprentice

Re: Bteq import the output characters got cut off by 2

#: When you define IMPORT VARTEXT all fields must be defined a VARCHAR

#2: You need to quote the filename when you want to add command options:

#3: You better add PACK to speed up the import

.logon tdpid/username,password;
.import vartext '' file = "C:\Users\myname\Documents\test\T_MbrshipID_Contro.txt",skip=2;

database DLabc;
.quiet on;
.repeat * pack 10000;
Using MbrID(char(10))
insert into MbrControl(Mbrship_ID)
values(:MbrID); --mbr is the heading in the txt file
.logoff;
Enthusiast

Re: Bteq import the output characters got cut off by 2

Thank you so much Dieter! It is working as expected. You made my day!