Re: COUNT (*)
Posted in 1997
The Rows Retrieved heading is sent to std error so redirect this to null to remove it, e.g. add "2> /dev/null" to the end of the command. The way I do it (SCO UNIX, Informix 4.10) is to throw away std error as above and pipe the script output through "grep" to get rid of unwanted lines setting a variable to the number of rows returned, e.g. z=`isql c2000 -qr t 2> /dev/null | grep -v count | grep .` Notes: 1 enclosing the sql in `` will (using SCO) put the result the variable on the left 2 "2> /dev/null" will throw away standard error, whch contains the "retrieved" line 3 "grep -v" will get rid of the "count" line 4 "grep ." will get rid of blank lines then echo ${z} will display the number of rows, but you can use it in a message for a more sensible display output it to a file, or whatever... have fun (this message may have been sent more than once, I'm using IE's news reader for the first time) Steve Edward Bidinotto <edbid@cobe.com> wrote in article <347B1FBC.6D29@cobe.com>... > To all" > > When you select count (*) > > isql dbname <<! > 1 row(s) retrieved. > > Is there any way to eliminate the 1 row retrieved within a script?