Several thoughts

1) Use a GUID for the key. It's a little large, but Delphi generates it quick and it is unique

2) use sequential keys and have a database table where the last (or next) key for each table is stored. Old school and might be a problem if the table already has some keys. yours don't. Also can be a bottle neck for multiuser/application databases.

3) Some database systems have a feature that will generate the next key (sequence)
I am working with BDE with queries to a Pervasive SQL database. Some of
the tables do not have primary keys and I need to create them on the
fly. When I say primary key fields I need to create a unique value for
each record each time the query is executed.



Does anyone have any ideas about how I can do this?


Jason Richards


_______________________________________________
Delphi-DB mailing list
Delphi-DB@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-db

Reply via email to