Don't want fixed length character output
Posted in 1999
Topics: General Discussion
If I do: output to somefile without headings select trim(column1) || ';' || nvl(column2, "") || ';' || nvl(column3, "") from table where <some where clause> I get fixed length character output as shown below ($ indicates the ACTUAL end-of-line) stuff;; $ stuff;ab;cd$ stuff;ef; $ stuff;;hi $ What I want is: stuff;;$ stuff;ab;cd$ stuff;ef;$ stuff;;hi$ Is there a way to do this? I tried "trimming" the full concatinated line: trim(trim(column1) || ';' || nvl(column2, "") || ';' || nvl(column3, "")) but that didn't work either.
If you want control over the output format, don't use DB-Access.
Consider SQLCMD from the IIUG archives, or use:
UNLOAD TO somefile DELIMITER ";"
SELECT column1, nvl(column2, ""), nvl(column3, "")
from table where <some where clause>
With UNLOAD, I doubt if the NVL functions are necessary.
Gerald wrote:
> If I do:
> output to somefile without headings
> select trim(column1) || ';' || nvl(column2, "") || ';' || nvl(column3,
> "")
> from table
> where <some where clause>
>
> I get fixed length character output as shown below ($ indicates the
> ACTUAL end-of-line)
> stuff;; $
> stuff;ab;cd$
> stuff;ef; $
> stuff;;hi $
>
> What I want is:
> stuff;;$
> stuff;ab;cd$
> stuff;ef;$
> stuff;;hi$
>
> Is there a way to do this? I tried "trimming" the full concatinated
> line:
> trim(trim(column1) || ';' || nvl(column2, "") || ';' || nvl(column3,
> ""))
> but that didn't work either.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.62 -- see http://www.perl.com/CPAN
#include <disclaimer.h>