Skip to Content.
Sympa Menu

freetds - Re: [freetds] freebcp out from MS SQL Server drops spaces [NC]

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Cedric ROUVRAIS <cedric.rouvrais AT sgcib.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] freebcp out from MS SQL Server drops spaces [NC]
  • Date: Thu, 9 Jul 2009 11:40:06 -0400



freetds-bounces AT lists.ibiblio.org wrote on 07/09/2009 11:33:57 AM:

> On 07/09/2009 09:35 AM, Cedric ROUVRAIS wrote:
> >
> ... <snip> ...
>
> > */
> > if (rows_written % 1000 == 0) {
> > printf("%d rows successfully bulk-copied to
> > host-file.\n", rows_written);
> > }
>
> Since freebcp supports the -b batchsize option, should the rows_written
> be compared to the const 1000 or to pdata->batchsize ?

Sybase BCP does not take into consideration the batch size for printing to
stdout progress. In other words no matter what value you put for the -b
option, it will always send to stdout every 1000 rows the message "x000
rows successfully bulk-copied to host-file.".


> Should the messages be written to stdout or to stderr (via fprintf( )) ?

Sybase BCP sends to stdout. We don't use this printing in our apps, but
when we manually bcp we appreciate having a progress report on a regular
basis, especially for the very big files.

As for fprintf or printf, I just stuck to the same mecanism used for
"starting copy" and bcp finished.

> On another note, I kinda like having the output supressed ... With that
> in mind, would it make sense to add a -q (be quiet) flag ?

We just redirect stdout to /dev/null :o)

a++ Cedric


*************************************************************************
This message and any attachments (the "message") are confidential, intended
solely for the addressee(s), and may contain legally privileged information.
Any unauthorised use or dissemination is prohibited. E-mails are susceptible
to alteration. Neither SOCIETE GENERALE nor any of its subsidiaries or
affiliates shall be liable for the message if altered, changed or falsified.
*************************************************************************





Archive powered by MHonArc 2.6.24.

Top of Page