Skip to Content.
Sympa Menu

freetds - RE: [freetds] Status: bcp

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Status: bcp
  • Date: Fri, 19 Dec 2003 12:08:41 -0500

> From: Castellano, Nicholas
> Sent: December 19, 2003 11:19 AM
> > > From: Castellano, Nicholas
> > > Sent: December 18, 2003 4:13 PM
> > >
> > > These SYBEBBCI messages are definitely required when
> > > bcp_exec() is used, and
> > > I have code that relies on this behavior.
> > >
> > > I don't know enough about the other parts of the bcp API to
> > > say for certain
> > > whether it's specific to bcp_exec() or not.
> >
> > What does your handler return?
>
> It returns INT_CANCEL. Here is the code from my error
> handler routine.
>
> /* Be concise for "Batch successfully copied" messages.
> Print server message only if main program is not managing
> a batch counter.
> */
> if (errno == SYBEBBCI) {
> if ((batch_counter < 0) || (batch_size < 0)) {
> fprintf(stderr, "%s\n", dberrstr);
> } else {
> batch_counter += batch_size;
> fprintf(stderr, "%d records loaded to database\n",
> batch_counter);
> }
> dbcancel(dbproc);
> return (INT_CANCEL);
> }

Thanks, Nick, I see I have to modify my theory to fit the facts. Bill
linked my new bcp.c unit test to Sybase's libraries, and got no message.
His experience matches mine: I've never seen that or coded against it.

It would make sense that bcp_batch() would not emit that message, because
the application *knows* the batch was just committed based on the return
code from bcp_batch().

It would also make sense for bcp_exec() to emit that message if BCP_SETL had
been called to set a batch size for the loading of an external file.
There's no other way the application could be notified of the ongoing status
of the load.

I would be willing to believe that informational messages can be returned
INT_CANCEL without harm.

--jkl
-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page