Skip to Content.
Sympa Menu

freetds - Re: Error handling

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Bill Thompson" <thompbil AT exchange.uk.ml.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: Error handling
  • Date: Fri, 14 Jun 2002 10:52:08 -0400


Brian,
>
> What do you mean exactly? Do you want to throw a client error to the
> application, ala "Query Pending"? If so you can just call
> tds_client_msg(), the problem is that dbconvert() and friends can be
> called without a dbproc and therefore tds_convert gets called without a
> TDSSOCKET structure.
>

That's all I needed. I hadn't realised that tds_client_msg was callable
from elsewhere than token.c I can see that other bits call it now.

I'm just trying to make freebcp more production worthy - so when I hit a
conversion error (processing a character file and finding nonsense in a
date field for example), I can make sure an appropriate error message is
out put...

This is an example of "real" bcp hitting bad data...

Starting copy...
DB-LIBRARY error:
Data-conversion resulted in overflow.
DB-LIBRARY error:
Attempt to convert data stopped by syntax error in source field.
DB-LIBRARY error:
Attempt to convert data stopped by syntax error in source field.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.

bcp copy in partially failed
21 rows copied.

I'm just trying to reproduce this behaviour...

Bill




Archive powered by MHonArc 2.6.24.

Top of Page