BTEQ Export / Import issue

Tools & Utilities
Enthusiast

BTEQ Export / Import issue

Hey all,
I'm trying to export a show table statement into a INDICATA file and then import that file into another table. My script runs fine but keep getting an out of data warning. Any ideas? Do I need to try to import using an alternate format? Thanks in advance.

SCRIPT:
bteq <<-EOF 1>>bteq$$.log 2>&1
.logon mybox/myid,mypass
.EXPORT INDICDATA FILE=test
show table rad.mytable;
.IMPORT INDICDATA FILE = test
.REPEAT *
using intxt (varCHAR(200))
insert into rad.showtable (mytext) Values( :intxt);
.logoff;
.quit;
EOF

FROM LOG:
+---------+---------+---------+---------+---------+---------+---------+----
using intxt (varCHAR(200))
insert into rad.showtable (mytext) Values( :intxt);
*** Warning: Out of data.
+---------+---------+---------+---------+---------+---------+---------+----
2 REPLIES
Teradata Employee

Re: BTEQ Export / Import issue

After the "show table" and prior to the .IMPORT, try this command:

.export reset

That will close the file "test" and return the output destination to the console instead of the file.
-- SteveF
Enthusiast

Re: BTEQ Export / Import issue

Thanks Feinholz, I added the reset and now get an error stating the source parcel length doesn't match the definition. The length of each line in the file "test" is much smaller than 200. Any ideas? Could it be that show table results contains delimiters like spaces and commas? I thought that using the indicadata format would prevent that from being an issue. Thanks again for the assistance!

*** Starting Row 0 at Fri Jan 28 09:52:05 2011
*** Growing Buffer to 1694
*** Failure 2673 The source parcel length does not match data that was defined.
Statement# 1, Info =1
*** Total elapsed time was 1 second.
*** Warning: Out of data.