freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] freebcp out from MS SQL Server drops spaces [C1]
- From: "James K. Lowden" <jklowden AT freetds.org>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] freebcp out from MS SQL Server drops spaces [C1]
- Date: Mon, 6 Jul 2009 22:33:46 -0400
Cedric ROUVRAIS wrote:
>
>
> We have several views that we use to format files that have to be sent
> to external applications and we have an issue that we have been unable
> to resolve. The Free BCP command drop trailing spaces (or inserts tabs)
> which mucks up the file.
>
> Usually what we do (with Sybase and MS SQL bcp it works just fine), is
>
> bcp dbInstance.dbUser.dbView out formattedFile.dat -c -t"" ...
freebcp as a report writer? Learn something new every day! ;-)
You could modify bcp.c::_bcp_exec_out (line 728). Change the fwrite to
pad character columns with spaces.
bsqldb *almost* does what you want. It puts two spaces between columns,
though. If you use any other delimiter, it doesn't pad character data.
I think what you want is sqsh. The -s option lets you set the column
separator.
You bring up an interesting philosophical point: are trailing spaces data?
IMO, no, they're not, and freebcp is correct not to pad character data.
Evidently the authors of bcp thought otherwise, hence the tiny
incompatibility.
HTH.
--jkl
-
[freetds] freebcp out from MS SQL Server drops spaces [C1],
Cedric ROUVRAIS, 07/06/2009
- Re: [freetds] freebcp out from MS SQL Server drops spaces [C1], James K. Lowden, 07/06/2009
- <Possible follow-up(s)>
- Re: [freetds] freebcp out from MS SQL Server drops spaces [C1], Cedric ROUVRAIS, 07/07/2009
- Re: [freetds] freebcp out from MS SQL Server drops spaces [C1], Cedric ROUVRAIS, 07/07/2009
- Re: [freetds] freebcp out from MS SQL Server drops spaces [C1], Cedric ROUVRAIS, 07/07/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [C1],
Cedric ROUVRAIS, 07/08/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [C1],
James K. Lowden, 07/08/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [NC],
Cedric ROUVRAIS, 07/09/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [NC],
Frediano Ziglio, 07/09/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [NC],
Cedric ROUVRAIS, 07/09/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [NC],
Frediano Ziglio, 07/09/2009
- [freetds] fsql does not support -b option [NC], Cedric ROUVRAIS, 07/09/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [NC],
Frediano Ziglio, 07/09/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [NC],
Cedric ROUVRAIS, 07/09/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [NC],
Frediano Ziglio, 07/09/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [NC],
Cedric ROUVRAIS, 07/09/2009
-
Re: [freetds] freebcp out from MS SQL Server drops spaces [C1],
James K. Lowden, 07/08/2009
Archive powered by MHonArc 2.6.24.