|
Peter, You bring up a very valid point when trying to create "unique" keys. The bigger question is, is this the best technique, or, are unique keys truly needed. IMHO, if you have a true need for a unique key, a timestamp will work nicely. But, unless this key is going to be propagated to child records, there is no true need for it's existence. The purpose of a key is to identify an entity so that other files can have a relationship with that entity. Otherwise it's existence is just a programming exercise. All keys being equal, without a child dependency, the record number can be used to identify uniqueness. Peter Dow wrote: > Hi István, > > I don't see a reply from Dan, so I'll jump in. <<snip>> > As someone pointed out in another message, there is a > remote possibility that after having checked for an existing record and > before doing the actual write, another job could actually add that record, > causing the duplicate error. > +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.