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: How to use BCP and Perl
Date: Sep 19 2002 9:22AM

On Tue, 2002-09-17 at 12:53, Mark Sutfin wrote:
> To BCP data into an SQL Server db table, I have been using this code
> snippet:
> system 'bcp ccr_dev..personofferhistoryload in
> g:\agisdev\docs\currdev\11425\bcp_infile.txt -c -e bcpload_fail.txt -h
> "ORDER (personid ASC)" -Uusername -Ppasswd -Sservername';
> I would like to capture some of BCP's messages, (e.g. starting to copy, rows
> sent to server, packet size).
> I realize this is not a list for SQL Server, but any direction would be much
> appreciated.
> SQL Server 2000

I suspect that bcp sends its output to either stderr or stdout. You need
to capture these filehandle streams in the parent process. Look at file
handle duplication and redirection in the perlfunc man page (under the
open() function).

Michael
-- 
Michael Peppler / mpeppler@peppler.org / http://www.mbay.net/~mpeppler
mpeppler@zetatools.com / ZetaTools, Inc / http://www.zetatools.com
ZetaTools: Call perl functions as Sybase stored procedures!