<No Subject Supplied>
Posted in 1993
Raymond Bowers wrote recently....
> I am using Informix SE 5.0 on SCO Unix, Open Desktop 2.0
>I am trying to allow users to run dbaccess and send the results to a file
>which
>can then be loaded into a spread sheet with Wingz. I have two problems so
>far.
>
> First, spaces are used to separate the columns, but Wingz needs TABs to
>separate columns. In ORACLE (blah!), I could set what I wanted the column
>deilmiters to be, and simply change them to TABs. Can I do this with
>dbaccess?
[stuff deleted]
> The best solution I can find so far involves letting the user develop the
>query as he wants, then adding 'unload to "filename"' above the query when
>done.
> This eliminates the problem of the columns coming out vertically arranged
>instead of across horizontally . . . But unload has undocumented
restrictions
>and will not save in a TAB delineated format.
>
[stuff deleted]
> Anyways, my simple solution for now is to let the user unload the data
from
>dbaccess, then from Wingz open a sheet, select a file and my program will
shell
>out to unix, run a simple awk script to convert all |'s to TAB's and then
use
>APPEND to pull the converted file in . . .
>
> That's my solution so far . . . Anybody else have any ideas?
>
1. First of all, you don't really need an awk script. The Unix function tr
will convert any character to any other within a file.
2. A slightly more elegant solution is to change the delimiter at the Unix
command line by typing
DBDELIMITER=<required character>
export DBDELIMITER
in your case <required character>= \\TAB
Of course, you must run this before you start the database, and it will
affect
ALL databases run by that process, but this may not necessarily be a
problem.
The best solution is probably to include these statements in the .profile of
the affected users.
I've tested this solution in Informix-SQL 2.10 running under Unix System 5
and
it works OK. Of course, like the VW beetle, it may have been "improved" out
of
existence in the later products....
** My opinions are my own ..I think. They're certainly not my employers.
Barry Toomey
AT&T Network Systems Ireland
bt@irl3b2c.att.com UUNET: att!irl3b2c!bt
--- End Included Message
------------------------------------------------------