Skip to Content.
Sympa Menu

freetds - Re: [freetds] freebcp adding escaping

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] freebcp adding escaping
  • Date: Fri, 15 Apr 2016 16:08:00 +0100

2016-02-03 4:40 GMT+00:00 Andrew Punch <andrew.punch AT smart-associates.biz>:
> Hi,
>
> I had a requirement to have properly formatted CSV output from freebcp.
> Unfortunately freebcp (and the original bcp) do not escape characters
> correctly. For example in a comma delimited file commas will not be escaped.
> Also the way NULLs are indicated can be inconvenient.
>
> I hacked together a patch which I have attached. I would like to do a pull
> after a clean up but I have a few questions:
>
> 1. is dblib the best place to make the change?
> 2. what is the best structure to pass parameters and flags? Namely:
> 1. Flag for delimiter escaping
> 2. The actual delimiter (I notice that the column delimiter changes
> to EOL for the last column)
> 3. Flag for NULL string replacement (instead of ASCII NUL)
> 4. NULL string replacement
>


Sorry for late reply.

Honestly looks quite weird to change freebcp. freebcp use a format
which is quite similar to normal bcp utility. I would honestly change
tsql instead.

Frediano




Archive powered by MHonArc 2.6.24.

Top of Page