BTEQ Export Columns

Teradata Applications

BTEQ Export Columns

I am having an issue where I have created a simple BTEQ script to output a simple *.csv file from a very simple db and the output in the file includes ONLY the first column.   

Here is a sample of the script:

 

/* loging in */
.LOGON mylogin, mypassword

/* Create file */
.SET SEPARATOR ',';

DATABASE mydb
.EXPORT REPORT FILE = "C:\temp\AllNameFile.csv";
SELECT LONG_NAME, SHORT_NAME
FROM NAME_TABLE;
.EXPORT RESET;
.LOGOFF;
.EXIT;

-------

The output is only include the LONG_NAME field.

The log file is showing:

 *** Query completed. 14 rows found. 2 columns returned.
 *** Total elapsed time was 1 second.

And exits with an error code of 0

 *** RC (return code) = 0

 

Any idea why I am only seeing one column in the output file?


Accepted Solutions
Highlighted
Teradata Employee

Re: BTEQ Export Columns

You probably need to tell BTEQ not to center the data, and that the total width may be more than the default 254 bytes

.SET FORMAT OFF

.SET WIDTH 32767

1 ACCEPTED SOLUTION
3 REPLIES
Highlighted
Teradata Employee

Re: BTEQ Export Columns

You probably need to tell BTEQ not to center the data, and that the total width may be more than the default 254 bytes

.SET FORMAT OFF

.SET WIDTH 32767

Re: BTEQ Export Columns

Thank you for the quick response... Really appreciate it.  But that did not work for me. 

 

Updated script look like this:

/* loging in */
.LOGON mylogin, mypassword

/* Create file */
.SET FORMAT OFF
.SET WIDTH 32767
.SET SEPARATOR ',';

DATABASE mydb
.EXPORT REPORT FILE = "C:\temp\AllNameFile.csv";
SELECT LONG_NAME, SHORT_NAME
FROM NAME_TABLE;
.EXPORT RESET;
.LOGOFF;
.EXIT;

 

Output is still ONLY the LONG_NAME column in the file. 

Re: BTEQ Export Columns

skip that last note... this works.  Thank you!