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: mpeppler at itf dot ch (Michael Peppler)
Subject: Re: BCP and index drop Questions
Date: Feb 22 1996 7:35AM

> From: jmanio19@eos.eos.net (John Manion)
> 
> First off, I'm completly new to sybperl and I apologize if any of this has
> been hashed out before.  Also, this is a long note, and I apologize for that as
> well, I'm trying to be thorough.  :-)

That's actually a good idea. At least we can then rule out a number of
potential problems...

That said, there are two problems that I can see straight away:

One is a syntax error:

     die "bcp_sendrow failed at row $Cnt" if ($SybSess->bcp_sendrow($SybSess, @dat) == FAIL);
should be
     die "bcp_sendrow failed at row $Cnt" if ($SybSess->bcp_sendrow(@dat) == FAIL);

But that's pretty trivial.

The big problem is that your input file needs a lot more parsing.

I ran the following script on your data:

#!/usr/local/bin/perl

while(<>) {
    chop;
    @d = split(/\t/);
    foreach $i (@d) {
        print "$i\n";
    }
}

I got the following results:

"MGMember.2"
1
"mcapdev"
"2/21/1996 12:01"
"mcapdev"
"2/21/1996 12:01"
"2/21/1996 12:01"
"000000000"
"MURPHY"
"19460608"
"JAMES"
"45405"
'Member ( MIDUOID MGMember.2 Name ( First JAMES Middle E Last MURPHY  ) SSN 000000000 DOB 19460608 Address ( Street1 "367 NILWOR AVENUE" City DAYTON State OH Zip 45405  ) Gender Male NOAid MGMember.2  ) '

This is exactly what you are feeding bcp_sendrow. I very much doubt
that this is what you want, and I'm fairly positive that the quotes are
unwanted.

If you can come back with a description of which portions of which
fields go into which columns (;-) we can probably figure out the
parsing pretty quickly...

Michael