🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #269

Re: DBKit: updating key fields

#269
From: Art Isbell
Date: Tue, 28 Jul 1992 02:53
15 lines
1318 bytes
Possibly, DBKit is trying to protect you from Sybase (and maybe many other
DBMS's).  Editting a key field is dangerous because Sybase implements an update
as a delete followed by an insert.  If the change you have made to a unique key
results in a duplicated key (another record with the same key exists), bye-bye
record.  The insert fails but the delete has already occurred!

So maybe the correct way to change a key is to insert a new record with the key
changed as you desire and if that succeeds, delete the previous record.
-- 

Art Isbell                                                      Cubic Solutions
NeXT Registered Developer #745         NeXT software development and consulting
Email: isbell@cats.UCSC.EDU                                Voice: (408)335-1154
USmail: 95018-9442                                           Fax: (408)335-2515
Technical Details
Message-ID: <152crfINN7ok@darkstar.UCSC.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!hal.com!darkstar.UCSC.EDU!cats.ucsc.edu!isbell
References: <1992Jul28.002103.29635@midway.uchicago.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!hal.com!darkstar.UCSC.EDU!cats.ucsc.edu!isbell
From: isbell@cats.ucsc.edu (Art Isbell)
Newsgroups: comp.sys.next.programmer
Subject: Re: DBKit: updating key fields
Message-ID: <152crfINN7ok@darkstar.UCSC.EDU>
Date: 28 Jul 92 02:53:35 GMT
References: <1992Jul28.002103.29635@midway.uchicago.edu>
Organization: Cubic Solutions - NeXT software development and consulting
Lines: 15
NNTP-Posting-Host: am.ucsc.edu