Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: RE: Sybase BCP
Date: Mar 4 2002 8:33PM
> Is there any particular reason not to use system( )? I'm not an expert, so
> I'm curious.
If you use system() you loose the output from the bcp
command. Depending one the situation this may not be a problem,
> Michael Peppler
> rg> cc:
> Sent by: Subject: RE: Sybase BCP
> 02/28/02 10:37 AM
> Please respond to
> 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
> > its output. Opening a pipe from it allows you to report on the progress
> > 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
> > situation.
> Michael Peppler Data Migrations, Inc.
> firstname.lastname@example.org *or* email@example.com
> International Sybase User Group: http://www.isug.com
Michael Peppler Data Migrations, Inc.
firstname.lastname@example.org *or* email@example.com
International Sybase User Group: http://www.isug.com