All Forums Tools
close2jay 2 posts Joined 10/15
13 Oct 2015
Issue with muting column names in bteq export file

 I am trying to export the 3 differrent select queries output to a single file (refer below)
bteq << EOB > log.txt 
.logon **********************
.export report file=result.txt
.set width 1000
--1st query
select metric, count(*) from tab1
-- 2nd query
select metric,count(*) from tab2;
--3rd query
select metric, count(*) from tab3;
.export reset
The above script is printing the column names 3 times in the result.txt but i want to print only once. I tried multiple options to avoid printing the column names for the 2nd and 3rd query but i couldn't able to figure it out. Could someone please help me on this.

dnoeth 4628 posts Joined 11/04
13 Oct 2015

Add (TITLE '') to each column, e.g.

select metric (TITLE ''),count(*) (TITLE '') from tab2;



close2jay 2 posts Joined 10/15
13 Oct 2015

When i tried to implement select metric (TITLE ''),count(*) (TITLE '') from tab2; I am getting the below error. Any idea on this..? Thanks.
 *** Failure 3707 Syntax error, expected something like ';' between the word 'Metric' and '('.
                Statement# 2, Info =39 

You must sign in to leave a comment.