Re: delimiters
Posted in 1992
Kristen Altman writes:
> Informix fans,
??? ;-)
> I need to be able to put a delimiter between the data fields returned from
> a select statement. This data is being written to standard output. An
> example would be:
>
> >isql testdb -
> >select field1, field2, field3 from test; {where the delimiter is "|"}>
> a |b |c |
> d |e |f |
How 'bout something like:
isql sis <<HERE
select gen_awb, "|", gen_stn, "|", gen_dtmadd
from gen_rec;HERE
which gives me :
gen_awb (constant) gen_stn (constant) gen_dtmadd
193627895 | ZEN | 700105446
916211133 | BSL | 700105446
530039510 | LUG | 700105446
14283651 | ZRH | 700105446
etc ...
You'll have to do the usual stuff to get rid of the headers,
etc, by writing it down a pipe and discarding stderr, but
that should swing it.
> Kristen Altman
>
> P.S. In Sybase, this is accomplished with the isql command. When you call
> isql, you can specify a delimiter to separate the fields. Maybe there's
> something similar in Informix that I don't know about (I hope).
So does that mean you're on the (Sybase) mailing list where you
get 15 copies of each piece of mail ? Great, see you there
often :-)
> *******************************************************
> * Kristen Altman *
> * kma@ccd.harris.com *
> * Harris Controls and Composition Division *
> * Melbourne, FL *
> *******************************************************
Hope this helps.
Cheers - Tony.
__________________________________________________________________________
Tony Heskett th@bnr.co.uk Voice: (+44) 279 402637
BNR, London Road, Harlow, Essex, CM17 9NA Fax: (+44) 279 454187