>snip...
>>
>>First I wouldn't suggest recno() as a PK. Assuming still you want it :
>>-Table where recno() is taken should be a another table.
>>-Whenever you want to take recno(), lock the table, get your recno() and release lock.
>>-For multiple tables, instead of just getting a recno(), keep an id at that particular table, for each of the tables, ie:
>>Table_id, Lastrecno
>>mycustomer 12
>>myorders 23
>>...
>>You can see an example for this in solutions.app and tastrade.app (Both can be find in help\sample applications).
>>-When you will get the recno() or id, lock the record or table. To prevent and endless lock attempt, "set reprocess to 1", try lock, if not locked continue trying lock with some delay.
>>Cetin
>
>Most programmers end up using something on this order. I have a different situaton where I have independent installations that may want to merge their data. I use SYS(3) to generate keys. One draw back is the number is nonsense and sometimes you would like to know the order records were added for audit purposes. Do you know of other draw backs to using sys(3)?
SYS(3) on fast machines does NOT generate random numbers..
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement