|
|
sybperl-l Archive
Up Prev Next
From: mpeppler at itf dot ch (Michael Peppler)
Subject: Re: BCP module
Date: Feb 16 1996 2:48PM
> From: Louis N Proyect
> This would be great. I have had nothing but headaches trying to run bcp
> from sybperl. The big problem is error-handling. It appears that your
> proposed approach is superior to plain-vanilla Sybase or am I reading too
> much into it?
One of the problems is speed. My initial implementation is approx 4x
slower than pure bcp (though I was running perl and the Sybase server
on the same machine, so cpu contention was high). But if you need to
munge the data before sending it into the dataserver then the speed
issue is less important - you still have process the datafile, which
will take time.
> From: "Doctor, Pranava J." (Pranava
> Doctor)
> The one very important issue I find is ill-sequencing of host file columns with
> sybase table columns.
>
> e.g.
>
> Host File Column Table Column
> 1 1 acct_nbr
> 2 2 acct_typ
> 3 None
> 4 3 acct_balance
> 5 None
> 6 10 delinquency_flag
>
> In other words, we may be getting a file but not using all the data from there.
> (This is especially so in case when you buy data from someone.)
>
Noted - I'll put that in.
> From: ajogleka@ltcm.com (Ashu Joglekar)
>
> 1. It would be nice to have control over the batch size (aka -b 1000 )
That's in there.
> 2. How about bcp out with a where clause ? I had hacked together a simple
> script to do this a while back (based on a script by David Neal on c.d.s)
> and we found it rather useful.
Is that very different from writing:
$dbh->dbcmd("select * from table where $condition");
$dbh->dbsqlexec; $dbh->dbresults;
$, = '|'; # I want to use | as field separator...
while(@dat = $dbh->dbnextrow) {
print "@dat\n";
}
I could always put that in somewhere...
Michael
|