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: Thomas Santamaria <tsant at ms dot com>
Subject: bcp_exec questions
Date: Aug 5 1998 5:15PM

Hi,

I am testing against a host file that I know will generate conversion
errors.  I am also using a basic error handler (very similar to the one
in sybutil.pl), that returns INT_CANCEL.  When I execute the bcp_exec
command and I get flagged for the conversion errors, control does not
seemed to be returned to the bcp_exec command, nor does it return FAIL.
This is puzzling.

Here's what the code segment looks like;

# -------------------
#  execute bulk copy
# -------------------
   if ( $status = $bcp->bcp_exec == FAIL ) {
      print "bcp_exec returns a status of $status, sybase error =
$syb_error.\n";
      $bcp->dbclose;
      return $syb_error;
   }

   print "after bcp_exec if, status = $status, sybase error =
$syb_error.\n";

Here's what the output looks like;

Sybase error: 20050
Sybase error: Attempt to convert data stopped by syntax error in source
field.
after bcp_exec if, status = , sybase error = 20050.

If you look closely, you will see that the first print command does not
appear in the output, but the second one does.  I would have expected to
exit the subroutine with a return code of 20050.  Can anyone point out
what I'm not seeing?

Also, it seems as though the SybPerl version of bcp_exec doesn't support
the "rows_copied" that it's DB-Library does.  How does one easily find
the number of rows copied?

Thanks in advance,
Tom