BTEQ - Exporting results to a file in Teradata

You can export/write the output of Teradata SQL command to a local file by EXPORT Bteq command.

Syntax:
.EXPORT FILE = <Local path>;


Example:
.LOGON localtd/dbc,dbc;
.EXPORT FILE = C:\TX\out.txt;
.SET SEPARATOR '|'

DATABASE forgetcode;
SELECT * FROM tbl_employee;

.LOGOFF
.EXIT


Result:
The SELECT statement output will be written into the file C:\TX\out.txt;
Each column content will be separated by '|'