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: Robert Lang <rlang at lincap dot com>
Subject: RE: bcp and select, not the same time?
Date: Jul 30 1999 7:45PM

Personally, I'd go with opening a temporary file, 
Process the input records one-by-one writing out bcp records to the
temporary file
Close the File and then bcp that into the target.

The advantages of this approach are low memory consumption  (only a single
input record in memory at one time.)
better speed  (simple disk read/writes to the local filesystem will be
faster than bcp'ing into any table)
less work on the Sybase Server.  (The select into will generate log entries,
while the bcp will not.)
a single database connection
no chance the process deadlocking itself.

The only downside that I can see is if you run out of disk space, you're


Robert Lang

-----Original Message-----
From: WORENKLEIN, David, GCM [mailto:David.Worenklein@GCM.COM]
Sent: Friday, July 30, 1999 8:42 AM
To: SybPerl Discussion List
Subject: RE: bcp and select, not the same time?

You can bcp into a temp table.  Then, when you're done, you can

insert into real_table
select * from temp_table

-----Original Message-----
From: []
Sent: Friday, July 30, 1999 8:16 AM
To: SybPerl Discussion List
Subject: Re: bcp and select, not the same time?


Thanks for writing. You are right,  my program is locking itself up. I was 
and bcp in from/to the same table.   I have never thought that bcp_sendrow 
lock the data page.  I thought bcp_batch is the time when data page get 

The sybook has the following words on bcp_sendrow:
"rows are permanently saved in SQL Server only when the user calls
bcp_batch or bcp_done".   I should have read between lines.

I now have to abandon the bcp idea for what I am doing.  This is bad!

Thanks again for help