Re[2]: using the output of a sql statement in a shell script
Posted in 1998
Try this.
response=`
{
dbaccess equip - << EOF
output to pipe "cat" without headings
select tabname from systables where tabid > 99 and tabid < 110EOF
} 2>/dev/null `
echo $response
______________________________ Reply Separator _________________________________
Subject: RE: using the output of a sql statement in a shell script
Author: MIME:David.Ashby@workcover.nsw.gov.au at INTERNET
Date: 14/08/98 10:52
Joseph,
No there isn't. Just use something like "tail +3 file | sed '/row(s)
retrieved/d' to eliminate the rows.
Regards
David Ashby
-----Original Message-----
From:joseph.luczynski@mindspring.com
[mailto:joseph.luczynski@mindspring.com]
Sent:Friday, 14 August 1998 3:45
To:informix-list@iiug.org
Subject:using the output of a sql statement in a
shell script
Is there a SQL statement that can give me the output of
the switches without
the "switch_id" and/or the "14 row(s) retreived." text?
There may be any amount of switches, and I either need
to write the shell
script to parse the extra text out, or get the SQL
statement to omit it.
Thanks for your help!
================================================
response=`
{
dbaccess ${dbname} - <<EOF
select switch_id from switches where switch_id4 = "M1"EOF
} 2>&1 `
echo $response
#switch_id RIM 2JY 2JV CLX 2OR ASC AU1 AUP BCS AUA AUO
BOY BHW 2M8 14 row(s)
retrieved.
-----== Posted via Deja News, The Leader in Internet
Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own
Free Member Forum