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: "Scott Zetlan" <scottzetlan at aol dot com>
Subject: RE: problems with Sybase::BLK?
Date: Jun 17 2002 8:27PM

You'll probably need to escape the pipe.  Try:
SEPARATOR => '\|',

instead.  Sybase::BLK uses full regular expression matching for separators,
so it's interpreting your '|' character as a regular expression would:

@fields =~ split /|/, $line;

would yield one field for each character -- not what you want.

Scott
  -----Original Message-----
  From: owner-SYBPERL-L@list.cren.net
[mailto:owner-SYBPERL-L@list.cren.net]On Behalf Of Dennis Domingo
  Sent: Monday, June 17, 2002 4:15 PM
  To: SybPerl Discussion List
  Subject: Re: problems with Sybase::BLK?


  Hi Michael:

  I've tried your suggestion as well removing 'RECORD_SEPARATOR for the
configuration

  Now I get the same error for each line in my file each describing the line
number in the bcp input file.

  mytestbcp.pl: 06172002-1308 - More columns passed to blk_rowxfer() than
were all
  ocated with blk_init() at
/usr/local/depot/perl-5.6.0/lib/site_perl/5.6.0/sun4-s
  olaris-thread/Sybase/BLK.pm line 539,  line 5

  thanx for your help.

  I'm not sure what to do,  I suppose I can use the perl function call
'system' and run Sybase's BCP from the command line from my program



  dd



    Michael Peppler  wrote:

    On Mon, 2002-06-17 at 10:23, Dennis Domingo wrote:
    > I get these errors when using Sybase::BLK

    > mytestbcp.pl: 06172002-0942 - More columns passed to
    > blk_rowxfer() than were allocated with blk_init() at
    > /usr/local/depot/perl-5.6.0/lib/site_perl/5.6.0/sun4-solar



    > 41 $bcp->config(INPUT => $bcp1File,
    > 42 OUTPUT =>
    > $ProcessTMConf::TMBCPTABLE,
    > 43 SEPARATOR => '|',
    > 44 RECORD_SEPARATOR => '\n'

    Try using "\n" for the record separator instead of '\n'.

    Remember that \n isn't interpolated in a single quoted string.

    Michael
    --
    Michael Peppler / mpeppler@peppler.org / http://www.mbay.net/~mpeppler
    mpeppler@zetatools.com / ZetaTools, Inc / http://www.zetatools.com
    ZetaTools: Call perl functions as Sybase stored procedures!
    > ATTACHMENT part 2 application/pgp-signa! ture name=signature.asc




----------------------------------------------------------------------------
--
  Do You Yahoo!?
  Sign-up for Video Highlights of 2002 FIFA World Cup