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: "Doctor, Pranava J dot " <Pranava dot J dot Doctor at nmb dot norwest dot com> (Pranava Doctor)
Subject: Re: BCP module speed
Date: Feb 21 1996 1:53PM

SNIP -X SNIP


>
> > The upload consists of 10000 rows of 12 fields each, sent in 200 row
> > batches, and there was no index or trigger on the target table, so
> > 'fast' (non-logged) bcp was used.
> >
>
> Just to clarify my understanding. If you use BCP library, it will always be a
> slow BCP. I thought I read to this effect in the BCP Library manual. I  may
be
> wrong.
>
> Anyone ?
>
>
> Pranava.
>


I eat my own words. Sorry for wasting the bandwidth.

I confused it with BCP_OPTIONS. They are not in effect (BATCH_SIZE etc) for
BCP_SENDROW. You have to do a BCP_BATCH everytime you think fit.

What I don't understand is every BCP_BATCH starts a new transaction (as per the
Sybooks). In which case isn't it a logged version of BCP ?

Pranava.

P.S. Michael ! You had mentioned about callback functionality in BCP ?
Where can I find info on this ? Just for educational reasons.



========= LOOK BELOW ==============


X-Listname: SybPerl Discussion List 
Warnings-To: <>
Sender: owner-sybperl-l@trln.lib.unc.edu
Reply-To: SYBPERL-L@trln.lib.unc.edu

> From: "Doctor, Pranava J."  (Pranava
>       Doctor)
>
>
> No. On the way out, we could do that. Its on the way in. I would read the
file
> in a while loop, unpack the fields into an array and then check the selection
> criteria for selective BCP in.

Sybase::BCP allows you to define a callback for each field. We could
add a global callback which would get passed the entire row (as an
array reference, probably) and if you return undef (or false, or 0)
from the callback then the row is skipped. I'll run some tests to see
what the speed hit would be.

Michael


-- 
Every child comes with a message that GOD has not yet given up on mankind.
						- Rabindranath Tagore.
+---------------------------------------+--------------------------------------+
|Pranava Doctor.			| Norwest Mortgage.		       |
|1235 11th Street, Apt. 213.		| Midas Dept. Unit # 5386.	       |
|W. Des Moines, IA 50265-2595.		| 405 SW 5th St., Des Moines,IA 50309  |
|Tel :(515)267-1107			| Tel :(515)221-4271		       |
+---------------------------------------+--------------------------------------+