Issue with muting column names in bteq export file

Tools & Utilities

Issue with muting column names in bteq export file

Hi,

 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

.set TITLEDASHES ON;

--1st query

select metric, count(*) from tab1

-- 2nd query

select metric,count(*) from tab2;

--3rd query

select metric, count(*) from tab3;

.export reset

.quit;

EOB

 

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.

 

Thanks,

Tags (1)
2 REPLIES
Junior Contributor

Re: Issue with muting column names in bteq export file

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

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

Re: Issue with muting column names in bteq export file

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