As mentioned before, BTEQ is quite powerful tool if you know how to use it. One of such good feature is the usage of the import and export command. If you want to export your data to a file, follow the steps; 

First set the export file

.export data file= c:\mypath\myoutputfile\output.txt;

You can also write the following for a formatted output.

.export report file= c:\mypath\myoutputfile\output.txt;  

Run the query.

SELECT * FROM TABLE_NAME;

Reset the export after export is done.

.export reset;

If there is a need to export as comma delimited; here is the way

.export data file = c:\mypath\myoutputfile\output.txt;

SELECT CAST (Column1||’,'||

 Column2||’,'||

Column3||’,'||

ColumnN||’,'||As char (250)) (This declaration is to hold all the column names plus commas)FROM tablename

SAMPLE 25;

.export reset;

Our Random Articles

More Links