Skip to Content.
Sympa Menu

freetds - Re: [freetds] freebcp -c and newlines

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: matthew.green AT datamartcomputing.com
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] freebcp -c and newlines
  • Date: Fri, 07 Aug 2015 08:05:35 +0000

The vendor tools behave in the same way as freebcp, so in some respects it
would be better to keep it "as is". Most people simply use the column
separator and row separator options to get round this and if you get it wrong
it usually fails part way through the "bcp in" with an error anyway.

I usually use grep to check the file for separators I'm considering using.

However, improving on what the vendors do without breaking compatibility
seems like a good idea. So if the bcp out checks to make sure the data
doesn't contain the separators and it doesn't slow it down then I'm all for
it.

Hope you'll excuse my "thinking out loud" style of reply!

Matthew.


August 7 2015 9:15 AM, "Ed Avis" <eda AT waniasset.com> wrote:
> freebcp -c writes rows in a simple text format with a newline character at
> the end of each row. But if one of the columns itself contains a literal
> newline the output will be corrupt. It would be better for freebcp -c to
> check for newlines when writing data, and exit with an error status if it
> finds one. Probably it should also check for the separator character. If
> you want to write arbitrary data to a file you should use the binary bcp
> output format.
>
> If you agree that this would be a useful safety check to prevent corrupt
> output, I could submit a patch.
>
> --
> Ed Avis <eda AT waniasset.com>
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page