RE: fixed length fields
Posted in 1995
>Date: Thu, 22 Jun 1995 20:39:10 +0200
>From: wayne@jones.mac.alt.na (Wayne Harlech-Jones)
>X-Informix-List-Id: <list.6697>
>"Output to" works fine for unloading fixed length data. Using "select
>f1||f2||f3" does work, sometimes. Some anomalies seem to crop up with
>numbers, so it is not really reliable, but it is not a feature I knew about
>before.
>Sorry Jonathan, it appears that you can use ISQL to unload fixed length data.
It depends on how fixed an output format you want. If the table is small enough,
then yes, using 'OUTPUT TO "file" WITHOUT HEADINGS SELECT * FROM SomeTable;' will
produce fixed width output. But try it on this table:
CREATE TEMP TABLE SomeOtherTable
(
Col01 CHAR(256),
Col02 CHAR(256),
Col03 CHAR(256),
):
INSERT INTO SomeOtherTable VALUES('a', 'b', 'c');OUTPUT TO "file" WITHOUT HEADINGS SELECT * FROM SomeOtherTable;
This gave me the following output (with each output line preceded by '--'
and followed by '@@', generated using the command "sed -e 's/^/--/' -e
's/$/@@/' file"):
--@@
--@@
--@@
--a@@
--b@@
--c@@
That looks like 3 blank lines and 3 non-fixed width lines for 1 row of data
in the table -- not my idea of fixed format output! If that meets your
requirements, then I'm delighted. I'm fussier.
Yours
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>