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: Michael Peppler <mpeppler at peppler dot org>
Subject: RE: Sybase BCP
Date: Feb 28 2002 4:37PM

Scott Zetlan writes:
 > Michael Peppler writes:
 > > Scott Zetlan writes:
 > >  > If you don't need to do any of that, just call the Sybase
 > > utility -- but
 > >  > don't use system(); open a pipe instead:
 > >  > open (BCP, "bcp... |");
 > >
 > > Or you can use backticks:
 > >
 > > my $bcp_output = `bcp ....`;
 > >
 > 
 > But then you have to wait for the process to complete before you can examine
 > its output.  Opening a pipe from it allows you to report on the progress of
 > the bulk-copy as it's in progress.

Correct, although I suspect that bcp will buffer its output when
writing to a pipe, in which case you'll have to wait until 1k has been
written to the output before getting any data.

 > Of course, there's more than one way to do it :)  Use whatever works in your
 > situation.

Indeed.

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
mpeppler@peppler.org           *or*          mpeppler@mbay.net
http://www.mbay.net/~mpeppler
International Sybase User Group: http://www.isug.com