Re: using the output of a sql statement in a shell script
Posted in 1998
Hi josephatlanta,
another way is to send the output into an extra file using the prefix
output to <file> without heading select ... from ...
and than work with this temporary datafile
Hope this helps
Uwe
josephatlanta@my-dejanews.com wrote:
> 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