Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Avis, Ed" <avised at kbcfp dot com>
Subject: RE: Bulk insert/load API access from DBI
Date: Jul 6 2004 3:59PM

Michael Peppler wrote:

>I've been asked to investigate the feasibility of adding access to
>Sybase's bulk-load API in DBD::Sybase. This is an API that 
>allows you to load table rows in a minimally logged manner, and is of
>course much faster than normal INSERT statements.

As you know, there's already a Sybase::BCP module but it's slower than
the command-line 'bcp' tool.  In principle, DBD::Sybase could provide
access to that using the same interface as ordinary bulk loads.

>Maybe something like:
>$sth = $dbh->prepare("BULK INSERT  -- attributes to be
>while(<>) {
>   @row = split('\|');   # or whatever...
>   $sth->execute(@row);

IMHO - making up bogus SQL statements and a new syntax for them is a
can of worms.  It would be much simpler to say

    $dbh->prepare_bulk(tablename, stuff...)

with some meaningful convention for the arguments (which doesn't
involve stuffing them into a single string and parsing it again).  You
can still use execute(), commit() and the other parts of the usual

Ed Avis