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)?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only