I can't seem to remove the ISQL headers
Posted in 2004
Topics: Versions, Editions & End-of-Life
I am trying to use ISQL to get a list of rows from a database. I use the command : isql -Sservername -Ublah -P -d dbname -Q \\"SELECT DELIVERABLE_ID FROM DELIVERABLE WHERE PRODUCT = 'whatever'" and I get : DELIVERABLE_ID -------------------- GV\\AB_CROWN GV\\AB_CROWN_UNIT GV\\POOL_RESERVES GV\\SK_CROWN GV\\SK_WELL (5 rows affected) My question is, how do I remove the headers (ie. "DELIVERABLE_ID" and the "--------------" and "(5 rows affected)) I did a bit of googleing and found people saying to use the "-b" option to turn the headers off.... which doesn't work for me (output is the same). Someone said you need version 11.1 or something better for the -b to work. I'm not sure how to find out what version I have or where to find a newer version. Is there a simpler way? I running ISQL through a windows command prompt. Thanx for any help you can give!! Ryan Ritten
Ryan Ritten wrote: > I am trying to use ISQL to get a list of rows from a database. I use > the command : > > isql -Sservername -Ublah -P -d dbname -Q \\"SELECT DELIVERABLE_ID FROM > DELIVERABLE WHERE PRODUCT = 'whatever'" > > and I get : > > DELIVERABLE_ID > -------------------- > GV\\AB_CROWN > GV\\AB_CROWN_UNIT > GV\\POOL_RESERVES > GV\\SK_CROWN > GV\\SK_WELL > > (5 rows affected) > > > My question is, how do I remove the headers (ie. "DELIVERABLE_ID" and > the "--------------" and "(5 rows affected)) > > I did a bit of googleing and found people saying to use the "-b" > option to turn the headers off.... which doesn't work for me (output > is the same). Someone said you need version 11.1 or something better > for the -b to work. I'm not sure how to find out what version I have > or where to find a newer version. > > Is there a simpler way? I running ISQL through a windows command > prompt. Is this the Informix ISQL, or is it someone else's product (Sybase, perhaps)? AFAIK, Informix's isql command does not accept -S for server name, -U for user name, -P for password handling, or -d for database name, let alone -Q for a command line query string. That's the sort of thing SQLCMD does (see http://www.iiug.org/). It has analogues for each option except -S (you build the server name into the database name): sqlcmd -d dbname@servername -u blah -p 'do not do this' -e \\ "select deliverable_id from deliverable where product = 'whatever'" If you are using Informix isql, then you'd use the OUTPUT statement to suppress the headings. (SQLCMD does not put headings in unless you ask it to with -H, or the number of rows unless you ask it to with -v.) See the manuals available from: http://www.ibm.com/software/data/informix/library -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
sparticusREMOVE@thesparticusarena.com (Ryan Ritten) wrote in message news:<f4d27a4f.0412031508.230be58a@posting.google.com>... > I am trying to use ISQL to get a list of rows from a database. I use > the command : > > isql -Sservername -Ublah -P -d dbname -Q \\"SELECT DELIVERABLE_ID FROM > DELIVERABLE WHERE PRODUCT = 'whatever'" Wrong newsgroup - this is almost certainly the Sybase version of isql. Anyway - to remove the headers use the -b option. To remove the "x rows affected" message, use the "set nocount on" T-SQL command. Michael