Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: return codes for Sybase::BCP functions
Date: Jun 15 1999 10:42PM writes:
 >      All-
 >      I am writing an app. that will copy rows from one table to another 
 >      (and from one remote server to another remote server).  It is really 
 >      important that nothing gets lost in here anywhere.  I am using 
 >      Sybase::CTlib to copy the rows out into a file, and Sybase::BCP to 
 >      BCP them back in.  I am trying to error check all lines of code, and 
 >      so was looking at the return codes from config() and run().  They 
 >      both seem to return values of 1 no matter whether they work or not.  
 >      Is this correct, or do I need more sleep?  (Though I suppose the two 
 >      questions are not mutually exclusive. *g*)  Should I just have a 
 >      custom error handler, and not worry about checking the individual 
 >      lines?  Any suggestions out there?  Thanks.

The Sybase::BCP code has not been updated in a quite a while, and I am 
unsure of the solidity (especially for error handling) of the code.

I would recommend that you use the bcp utility that Sybase provides,
as that is faster, and actually has better error handling.


run() should return the number of rows that actually made it to the
server without error (at least as far as the API told me). I have not
used this in a long time, so I can't confirm 100% that this *really*
works the way it's documented.

Michael Peppler         -||-  Data Migrations Inc.    -||-
Int. Sybase User Group  -||-
Sybase on Linux mailing list: