Re: delimiters
Posted in 1992
Topics: SQL Development & Query Writing, Migration, Import/Export & Data Conversion
In article <8743@emory.mathcs.emory.edu> kristen.m.altman@ccd.harris.com (Kristen Altman) writes:
>
>Informix fans,
>
>I am having a major problem with my application and I'm hoping that someone
>can help.
>
>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 |
>
>etc...
>My application uses only Informix-ISQL.
>
>If anyone has any idea how this might be accomplished (without using the
>unload command), I would love to hear from you!!
>
>Thanks in advance
>
>Kristen Altman
There's nothing specifically meant for this purpose, but you can simulate it
via an ACE report if that's an option:
-------------------------------------CUT HERE----------------------------------
DATABASE testdb
END
OUTPUT
LEFT MARGIN 0
END
SELECT
field1,
field2,
field3
FROM test
END
FORMAT
ON EVERY ROW
PRINT field1 CLIPPED,
"|",
field2 CLIPPED,
"|",
field3 CLIPPED,
"|"
-------------------------------------CUT HERE----------------------------------
If you can't use ACE, then you can do the following in sql alone:
SELECT field1, "|", field2, "|", field3, "|" FROM test;
You might have to do things to remove column names and other output garbage,
but the basic idea is there.