Hi Bruce,
Thanks for showing me the direction.
Hi Charl,
Thanks for your suggestion.
I have been playing around with autonumber On and Off in the dct.
As I am concerned, if I put the code in the Pre-Insert embed, both cases will be work. I think it is a matter of preference and perhaps old habits.
As to unique keys handling in SQL databases:
If not only Clarion, but also other software (Microsoft / Vb / Django, or whatever) update the SQL database, then indeed the best way is to have the database provide for the unique key.
But if all the programming is done in Clarion, then it might be easier and more flexible to do that in Clarion. When changing to another type of database or to a non-sql database, one does not have to worry about the unique key, because that is all handled by oneself.
Cheers,
Koen