Skip to Content.
Sympa Menu

freetds - RE: [freetds] How to do bulk updates

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Anwar, Mohammed" <mohammed.anwar AT intel.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] How to do bulk updates
  • Date: Tue, 4 Mar 2003 10:33:05 -0800

Thanks for your responses..
I will try these out.

Anwar

-----Original Message-----
From: Martin Spott [mailto:mas AT plesnik.de]
Sent: Tuesday, March 04, 2003 7:01 AM
To: FreeTDS Development Group
Subject: Re: [freetds] How to do bulk updates


On Tue, Mar 04, 2003 at 12:02:35AM -0500, James K. Lowden wrote:
> On Mon, 3 Mar 2003 17:45:46 -0800, "Anwar, Mohammed"
> <mohammed.anwar AT intel.com> wrote:

> > I was wondering what is the best way to implement bulk updates.
> > I have a large number of updates to do.

> 1. create a table suitable for bulkloading your file.
> 2. Use freebcp to load that table.
> 3. "update tgt from src set data = src.data where tgt.key = src.key".

If you like to be proud of your solution, then create a nice Perl script
that connects to the Database with DBI/DBD-Sybase or Sybperl and execute an
update statement for each row. Better you remove old rows that get replaced.
I've done such stuff and it works quite well even vor tables wit several
million rows (o.k., it takes few hours ;-)

Martin.
--
Unix _IS_ user friendly - it's just selective about who its friends are !
--------------------------------------------------------------------------




Archive powered by MHonArc 2.6.24.

Top of Page