PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
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

John_Erjavec@cargill.com 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.

However,

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
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com