|
|
sybperl-l Archive
Up Prev Next
From: Dennis Domingo <bigmango at yahoo dot com>
Subject: RE: problems with Sybase::BLK against Sybase 12.5.x - setting
client character set?
Date: Jun 18 2002 4:46PM
Hi Scott and Michael:
For this file that contains this data..
4|2001|3|3120|cdburn01|23509
4|2001|3|3120|kazaa|14531
4|2001|3|3120|winzip|13642
4|2001|3|3120|winamp|8261
4|2003|3|3120|osx|7861
4|2001|3|3120|ftp|7847
4|2001|3|3120|divx|7651
4|2001|3|3120|icq|5883
4|2001|3|3120|winrar|5359
4|2001|3|3120|games|5324
Changing the SEPARATOR parameter value to "\|" defintely works to copy in the files.. I'm rusty in my perl
But it looks like I am still getting errors
".
.
Open Client Message:
Message number: LAYER = (0) ORIGIN = (0) SEVERITY = (0) NUMBER = (0)
Message String: blk_rowxfer(): blk layer: internal BLK-Library error: Failed in convers
ion routine - syntax error. col = 5 row = 5.
.
.
"
These errors have something to do with setting the client character set with Sybase.12.5.x
Here is a select of my tables that I just bcp'd the data
siteId: 4
nodeId: 2001
editionId: 3
pageTypeId: 3120
searchPhrase: ????es"
searchHits: 23509
siteId: 4
nodeId: 2001
editionId: 3
pageTypeId: 3120
searchPhrase: ????es"
searchHits: 13642
siteId: 4
nodeId: 2001
editionId: 3
pageTypeId: 3120
searchPhrase: ????es"
searchHits: 8261
siteId: 4
nodeId: 2001
editionId: 3
pageTypeId: 3120
searchPhrase: ????es"
searchHits: 7651
Notice the BCP options:
bcp
usage: bcp [[database_name.]owner.]table_name[:slice_number] {in | out} datafile
[-m maxerrors] [-f formatfile] [-e errfile]
[-F firstrow] [-L lastrow] [-b batchsize]
[-n] [-c] [-t field_terminator] [-r row_terminator]
[-U username] [-P password] [-I interfaces_file] [-S server]
[-a display_charset] [-q datafile_charset] [-z language] [-v]
[-A packet size] [-J client character set]
[-T text or image size] [-E] [-g id_start_value] [-N] [-X]
[-M LabelName LabelValue] [-labeled]
[-K keytab_file] [-R remote_server_principal]
[-V [security_options]] [-Z security_mechanism] [-Q]
When I use command line bcp I need to specify -J client character set .
Sybase::BLK currently doesn't have any parameters in the config for character set settings.
That's probably what's causing the other errors... thanx.
dd
Michael Peppler wrote: Ak - I'd forgotten about that!
Thanks!
Michael
On Mon, 2002-06-17 at 13:27, Scott Zetlan wrote:
> 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
--
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-signature name=signature.asc
---------------------------------
Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup
|