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: abe dot crabtree at citicorp dot com
Subject: RE: BCP with Sybperl
Date: Aug 8 2002 4:20PM

The character set thing is a warning.  The row will still be copied.  Some 
characters will be "?" in the database.  This is because the character set on 
the client and server differ, and conversion could not happen, I think because 
not all characters in the client are present in the server, and your data file 
had some of these.

An example might be the British pound symbol , which sometimes misbehaves 
going on to an HP server with roman8 as the character set (I think.)

The next problem is going to be that your data file format does not match your 
format spec.  I'm not familiar with Sybase::BCP, but it is similar to the bcp 
utility.  Check that you really do have 33 fields for each row, and check what 
the record separator is (you haven't supplied one - maybe Sybase::BCP defaults 
to \n, or nothing - this is what you need to check.)

I hope this helps,


Abe Crabtree

-----Original Message-----
From: deolinda.pereira []
Sent: 08 August 2002 17:11
Subject: BCP with Sybperl


I'm trying to write a BCP routine (export data from a .txt file to import to a 
table) with Sybperl but i get an error:
  "Error converting client characters into server's character set.  Some 
  character(s) could not be converted."

I followed the example that comes with sybperl (file This error 
appears sometimes, the BCP ends, but it didn't copy all the lines. Why this is 
happening? It has to do something with the character set? If it does how do i 
solve this?

Then i tryed to write de next code:
    use Sybase::BCP;
    require '';
    $bcp = new Sybase::BCP $login, $pass, $server;
    $bcp->config(INPUT => $file,
	         OUTPUT => $table
   	         FIELDS => 33,
	         SEPARATOR => ';');

But this time i get a different error:
 "Attempt to convert data stopped by syntax error in source field."
Once more, i don't know i to solve this...?