Skip to Content.
Sympa Menu

freetds - Re: [freetds] freebcp failing to continue loading records afterduplicate encountere d

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Reid, Roger L." <roger.reid AT dpw.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] freebcp failing to continue loading records afterduplicate encountere d
  • Date: Mon, 2 Jul 2007 15:01:37 -0400

There's actually good reason to simply fail at that point, but whether it's
correct behavior depends on how your
table (or relation, or bag) is configured.

Run "sp_help [tablename]". Output will probably be a lot simpler than this.
Notice under index description, ind0 says "clustered, allow duplicate rows"
(Huh? I know this table, what young whippersnapper put "allow dups" in
there? Anyway...

"allow duplicate rows" - means just that - this is a bag, not a relation, and
it means something to us to have two identical rows in here. Do not page
Codd and Date for support.

"ignore duplicate rows" or "ignore duplicate key" means - if someone tries to
insert a row that already exists, just report success (but 0 rows affected).
It's not an error. The row belongs, it's already there, we're not worried
that the attempt means something's out of whack.

Otherwise, the default is that an attempt to insert a duplicate row (or a
duplicate unique key) is an error. We don't expect it to happen, so the
safest thing to do is stop processing.

I don't know your table. If you have not set the table up to allow dups or
to ignore dups, quitting is correct.

If you HAVE done so, and freebcp croaks on it anyway, then you have an issue
with freebcp.

In a perfect world of perfect relations and processes, you'd never allow or
ignore dups. In your case, it sounds like you want to ignore dups - see
"alter table" and "create index" in your Sybase docs.



index_name index_description
index_keys



index_max_rows_per_page index_fillfactor index_reservepagegap
index_created
-------------------- -------------------------------------------------------
---------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------
----------------------- ---------------- --------------------
-------------------
ind0 clustered, allow duplicate rows located on default
cli_nbr, mat_nbr



0 0 0
Jun 17 2006 7:57PM
ind1 nonclustered, unique located on default
seq_nbr



0 0 0
Jun 17 2006 8:04PM
ind2 nonclustered located on default
bill_nbr



0 0 0
Jun 17 2006 8:06PM
ind3 nonclustered located on default
law_nbr, work_date



0 0 0
Jun 17 2006 8:09PM
ind4 nonclustered located on default
sys_date, bill_status, work_date, cli_nbr, mat_nbr



0 0 0
Jun 17 2006 8:13PM

(5 rows affected, return status = 0)



-----Original Message-----
From: dnoble71 AT juno.com [mailto:dnoble71 AT juno.com]
Sent: Friday, June 29, 2007 11:22 PM
To: freetds AT lists.ibiblio.org
Subject: [freetds] freebcp failing to continue loading records afterduplicate
encountere d

I am new to Linux and freetds.

We are working with Sybase 12.5.3 on an HP 9000 Server.

On a Linux box using freetds 0.64, we run the freebcp command to load
records into a Sybase table and as soon as it encounters a duplicate
key in the table freebcp stops loading records.

I have seen freebcp continue to load records after it encounters a
duplicate key error on another system. Is there a configuration setting
in freebcp or Sybase that I need to set to allow for the loading of
records to continue?

thanks in advance for your help
Doug

_____________________________________________________________
Click to find great rates on medical insurance, save big, shop here
http://track.juno.com/s/lc?u=http://tagline.untd.us/fc/Ioyw6iifSXvkZ8ehfhuS0KKDEB83TWeZvNjOfDdvt1UQfT7wWBSpXT/







Archive powered by MHonArc 2.6.24.

Top of Page