Up Prev Next
From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: BCP Error handling
Date: May 15 1998 1:33AM
Craig Kickel writes:
> Good Morning,
> I've been using the CTlib portion of Sybperl for quite a
> while now -- and loving it.
> Today, I've come across my first need to use the BCP
> portion. So far it's been coming together pretty well.
> However, I'm not quite sure how to do the error handling.
> Normally, I would use ct_callback methods to put my own
> error routines in place. Of course, they aren't available
> under BCP/DBlib.
For normal DBlib calls you have dbmsghandle() that is basically the
same as ct_callback(CS_SERVERMSG_CB).
You should look at the documentation for the bcp_*() calls in the
Sybase manuals. Basically bcp_sendrow() only fails if there is an
error on the client side. If there is an error on the server (such as
a duplicate row, or a conversion error) it will be reported when
either bcp_done() or bcp_batch() are called.
Michael Peppler -||- Data Migrations Inc.
firstname.lastname@example.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com