Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suppress heading without using the "without heading" key words

Status
Not open for further replies.

aft5425

Programmer
Oct 23, 2012
16
US
Informix DB: 11.50.FC3
unix AIX: 6.1 o/s

i'm executing an isql statement and i want to suppress the headings. I'm using a unix script to execute the isql command and the unix script takes care of creating the output file...i'm not creating the output file in my isql statement.

Unix command isql dbtest getlist.sql > output.txt
getlist.sql executes the following sql:

select tablename
from tablelist
where tablename like '%_r_%';

my result set:

tablename
---------

ca_r_ttnam
ct_r_newsr
nm_r_jnews
tx_r_fnews

(4 rows listed)

I don't want the column heading, the "-----------", nor the "(4 rows listed)" to print. I know i can use the "without headings" keywords to suppress the headings, but that only works if i allow isql to create my output file (as far as i know). For example,

OUTPUT TO /u1/txt/output.txt WITHOUT HEADINGS select tablename from tablelist where tablename like '%_r_%';

But again, my unix script is creating the ouput file.

Any help is appreciated! Hope i'm in the correct forum to post this question.
 
A starting point:
isql dbtest getlist.sql | sed '1,2d;/rows listed/d' > output.txt

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes it looks like that would work, but i thought there was possibly a keyword i could use in my isql statement to suppress headings. If i could use the "WITHOUT HEADING" key words without isql having to create the output file, that would work for me.
 
What about this ?
isql [!]-s[/!] dbtest getlist.sql > output.txt

Anyway you may use this sort of thing in your sql file:
output to pipe "cat" without headings

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Ok thanks. I entered --> output to pipe "cat" without headings
as the first line of my sql and it worked...no headings. Thanks for your help. I made it harder than it was!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top