dbaccess vs column headers
Posted in 2008
Summary
The poster asked how to run a query through dbaccess from the command line without printing column headings, and how to get only data rows without blank lines. Replies pointed to SQL's OUTPUT TO <file|pipe> ... WITHOUT HEADINGS SELECT ...; or UNLOAD TO <file|pipe> DELIMITER '<TAB>' SELECT ...; for header-free output, with the suggestion to pipe the output through sed (available on Windows via Unix utility ports) to strip remaining blank lines.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
When using dbaccess from the command line to run a query, is there any
way to tell it to omit column headers?
Also, is there any way to only return data and trim out blank lines?
↪ replying to KStahl
KStahl wrote:
> When using dbaccess from the command line to run a query, is there any
> way to tell it to omit column headers?
>
> Also, is there any way to only return data and trim out blank lines?
Look for "output to pipe 'sed ....' without headings".
sed can remove empty lines. If you use M$ Windoze you can get Unix
utilities for Windows too.
HTH
Michael
↪ replying to KStahl
KStahl wrote:
> When using dbaccess from the command line to run a query, is there any
> way to tell it to omit column headers?
>
> Also, is there any way to only return data and trim out blank lines?
OUTPUT TO <file|pipe> WITHOUT HEADINGS SELECT....;
-or-
UNLOAD TO <file|pipe> DELIMITER '<TAB>' SELECT...;
Art S. Kagel
Oninit
===========================================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.oninit.com/home/disclaimer.php
===========================================================================================