Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Sybase::Xfer may not see delimiter?
September 14, 2006, 7:52 pm
rate this thread
'not sure if anyone can help here; I'm cross-posting to both a Perl & a
Sybase forum ....
I've used Sybase::Xfer (a Perl 5.8.6 module) to transfer data between
ASE 12.5.3 databases for months, in slightly varied applications with
Now I'd like to write a script which very simply bcp's data into a
table from a delimited file (which one would presume to be easier, or
so I'd have thought), and the module seems to ignore my delimiter for
some reason. The file in question is perfectly loadable by native
(Linux) bcp itself, but for a variety of reasons I'd rather do it using
this Perl module.
my %switches = (
my $h = Sybase::Xfer->new( %switches );
my %status = $h->xfer(-return=>"HASH");
die "xref failed. $status\n" unless $status;
#recnum=1, reason=number of columns in data record does not match
number of columns in target table
My table looks like: ( colA varchar(30), colB float )
My data file looks like: StringWithNoPipe |1.234
I notice that bcp wants both a column delimiter as well as a row
delimiter, while Sybase::Xfer seems to take just one; I'm not sure if
that's confusing it? (The file is newline delimited). I'm not even
sure the delimiter is the issue, and have tried tab (\t) rather than
pipe, various methods of quoting it (single quotes, double quotes,
variable interpolation, backslashed char, regexp, etc.
Any help greatly appreciated...
Keith Wingate / DBA