Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to get rid of isql headers, feedback...

2,157 views
Skip to first unread message

George Kerber

unread,
Jan 27, 1997, 3:00:00 AM1/27/97
to

I have experience with Oracle, and am now trying to be a Sybase guy.

Let me describe something I do with Oracle SQLPlus and want to be able
to get isql to do. I have asked everyone I know, and the best answer
I've received so far is to use unix sed...

In oracle I can write a sql statement like this

SET HEADING OFF
SET FEEDBACK OFF
SELECT * from sample;

When this returns, there are no column headers or a statement at the
bottom of the data telling me how many rows were returned.


Can isql do something like this? If so, please tell me how, and where
the information of this form of control along with others is documented.

Thanks in advance,


George Kerber
USWEST

Northeast Utilities

unread,
Jan 27, 1997, 3:00:00 AM1/27/97
to

You can get rid of feedback with the command SET NOCOUNT ON. You can get
rid of the headers by aliasing the returned columns to the NULL string,
i.e. SELECT ""=column,""=column, and so on. This method will still return
the underline before the first returned row, however.


Martin Moessel

unread,
Jan 27, 1997, 3:00:00 AM1/27/97
to

In article <32ECE7...@netmail.mnet.uswest.com>, George Kerber <gke...@netmail.mnet.uswest.com> writes:
== I have experience with Oracle, and am now trying to be a Sybase guy.
Welcome. Let me introduce you to the FAQ:
http://reality.sgi.com/pablo/Sybase_FAQ/
It's always worth to look at this site before posting.


== In oracle I can write a sql statement like this
==
== SET HEADING OFF
== SET FEEDBACK OFF
== SELECT * from sample;
==
== When this returns, there are no column headers or a statement at the
== bottom of the data telling me how many rows were returned.

to turn off the rowcount:
set nocount on
(see also http://reality.sgi.com/pablo/Sybase_FAQ/Q4.2.html)

to turn off printing headers (quoting an article I posted last week):
== == Q: how do u have sybase only return records you need WITHOUT the
== == column names and the ---- that comes after it?
== I suppose you're talking about isql? If so: up to isql 10.0.4 there's no
== option/command to do this. You have to strip it off with a sed/awk/perl
== script.
== isql 11.1 accepts the "-b" option to turn off printing of headers.

hope this helps

Martin
Sybase JDBC Development
m...@sybase.com

Bret Halford

unread,
Jan 27, 1997, 3:00:00 AM1/27/97
to

In article <32ECE7...@netmail.mnet.uswest.com>, George Kerber <gke...@netmail.mnet.uswest.com> writes:
|> I have experience with Oracle, and am now trying to be a Sybase guy.
|>
|> Let me describe something I do with Oracle SQLPlus and want to be able
|> to get isql to do. I have asked everyone I know, and the best answer
|> I've received so far is to use unix sed...
|>
|> In oracle I can write a sql statement like this
|>
|> SET HEADING OFF
|> SET FEEDBACK OFF
|> SELECT * from sample;
|>
|> When this returns, there are no column headers or a statement at the
|> bottom of the data telling me how many rows were returned.
|>
|>
|> Can isql do something like this? If so, please tell me how, and where
|> the information of this form of control along with others is documented.

There is a direct equivalent to "SET FEEDBACK OFF" in "SET NOCOUNT ON".

Headers are a different matter. Historically, there has been no way to turn
them off using isql. However, version 11.1 of isql was recently released as
part of the 11.1 Open Client package, and it does have a command-line parameter
to turn off headers (but it applies to all queries in the session).

SET NOCOUNT ON is documented in the 11.x Reference Manual, Vol 1, page 3-317.

isql 11.1 is documented in the 11.1 Open Client documentation. Presumably,
isql 11.1 will be included in the next release of SQL Server, at which
point it will be documented in the "Utility Programs" guide.

--
---------------------------------------------------------------------
| Bret Halford Imagine my disappointment __|
| Sybase Technical Support in learning the true nature __|
| 6400 S. Fiddlers Green Circle of rec.humor.oracle... __|
| Englewood, CO 80111-4954 USA |
============================================================


Dan McCuaig

unread,
Jan 30, 1997, 3:00:00 AM1/30/97
to

George Kerber wrote:
>
> I have experience with Oracle, and am now trying to be a Sybase guy.
>
> Let me describe something I do with Oracle SQLPlus and want to be able
> to get isql to do. I have asked everyone I know, and the best answer
> I've received so far is to use unix sed...
>
> In oracle I can write a sql statement like this
>
> SET HEADING OFF
> SET FEEDBACK OFF
> SELECT * from sample;
>
> When this returns, there are no column headers or a statement at the
> bottom of the data telling me how many rows were returned.
>
> Can isql do something like this? If so, please tell me how, and where
> the information of this form of control along with others is documented.
>
> Thanks in advance,
>
> George Kerber
> USWEST

I ran into this problem too. I ran an ISQL call from a Unix csh script
and redirected to a file. To get rid of the header, I processed the
output file using AWK. AWK ate the header for me. Sounds like a
kludge (and it is) but it was a quick and easy fix.

Dan

Peter Collard x3134

unread,
Feb 3, 1997, 3:00:00 AM2/3/97
to George Kerber

Have a look at SQSH by Scott Gray of Sybase Professional Services - its
free, and does everything that isql doesnt. It seems robust as well.

Try www.voicenet.com/~gray for a download.


George Kerber wrote:
>
> I have experience with Oracle, and am now trying to be a Sybase guy.

> In oracle I can write a sql statement like this

...


> Can isql do something like this? If so, please tell me how, and where
> the information of this form of control along with others is documented.
>
> Thanks in advance,
>
> George Kerber
> USWEST

--
+==================================================+
+ From: Peter WG Collard Senior DBA +
+ Lehman Brothers +
+ London +
+ Usual disclaimers apply.
+==================================================+

Mark Khoury

unread,
Feb 4, 1997, 3:00:00 AM2/4/97
to

Dan McCuaig wrote:
>
> I ran into this problem too. I ran an ISQL call from a Unix csh script
> and redirected to a file. To get rid of the header, I processed the
> output file using AWK. AWK ate the header for me. Sounds like a
> kludge (and it is) but it was a quick and easy fix.
>
> Dan

Yup. I've worked with both, and no, you can't do with isql what
you can do with SQL*Plus. Use awk.

=================
Mark Khoury
mar...@netcom.ca
Montreal, CANADA

J.Masino/T.Larson

unread,
Feb 5, 1997, 3:00:00 AM2/5/97
to

: George Kerber wrote:
: >
: > I have experience with Oracle, and am now trying to be a Sybase guy.
: > In oracle I can write a sql statement like this
: >
: > SET HEADING OFF

: > SET FEEDBACK OFF
: > SELECT * from sample;
: >
: > Can isql do something like this? If so, please tell me how, and where

: > the information of this form of control along with others is documented.

I'm afraid those won't be the only things from SQL*Plus that you'll
miss. COLUMN, TTITLE, SPOOL ... They're all extensions. :-(

There is no way to turn the headings off. People either edit the output
file and delete the headers, or use awk to parse them out, or tail +n
to skip the first few records in the file. You get the idea.

You can prevent the number of rows affected being displayed at the end.
Try SET NOCOUNT ON. That should do it.

If you want a crash course in syntax, take a look at the Sybase-provided
procedures. I've learned a lot about how things work from those puppies.

Good luck,
Teresa Larson

___________________________________________________________________
/ Teresa A. Larson http://www2.ari.net/jmasino/ /
/ Bell Atlantic Voice: (301) 282-0051 /
/ 13100 Columbia Pike, A-3-3 Fax: (301) 282-9416 /
/ Silver Spring, MD 20904 Teresa....@bell-atl.com /
/__________________________________________________________________/
#include <std_disclaimer>


Martin Moessel

unread,
Feb 5, 1997, 3:00:00 AM2/5/97
to

In article <5d8tht$9...@ari.ari.net>, tla...@ari.net (J.Masino/T.Larson) writes:
== There is no way to turn the headings off. People either edit the output
== file and delete the headers, or use awk to parse them out, or tail +n
== to skip the first few records in the file. You get the idea.

That's true for isql 10.0.4 and below. isql 11.1 supports the -b option.
If this flag is given the column headers will not be printed.

== You can prevent the number of rows affected being displayed at the end.
== Try SET NOCOUNT ON. That should do it.

That's correct.

0 new messages