creating an export file in bteq like sql assistant does

Tools
Enthusiast

creating an export file in bteq like sql assistant does

How do I create an export file similar to the one that SQL Assistant export does. In sql assistant I can specify a field enclose character and a field separator. I can do that in bteq (field separator) but can't find how to do a field enclosure.

2 REPLIES
Enthusiast

Re: creating an export file in bteq like sql assistant does

I've tried data file but I end up getting weird wing ding like characters in it. I've tried reprot file but I get a bunch of blank lines between the rows and the titles. 

Enthusiast

Re: creating an export file in bteq like sql assistant does

here is my script:

bteq $(cat $HOME/.tdlogon)

.SET WIDTH 65000;

.SET TITLEDASHES OFF;

.SET SURPRESS ON 1,2,3,4,5;

.SET FORMAT OFF;

.EXPORT DATA FILE = exprt.txt;

.SET SEPARATOR '~';

select col1, col2, col3, col4 from table1;

.LOGOFF;

.QUIT;

.EXIT