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

Cedric ROUVRAIS <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <OF8FF70CDB.C3C94221-ON852575EE.0055B7CC-852575EE.005611F4@us.world.socgen>

[email protected] 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.
*************************************************************************
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.