Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Retrieving an auto-incremented value
I have a child table and a parent table ; in the latter i use a autoincrement primary key. I have to insert (using SQL) in the child table and the parent table at the same time. So obviously I need to
1) Begin a transaction
2) INSERT INTO the parent table.
3) Retrieve the generated value of the autoincrement primary key.
4) INSERT INTO the child table using this value.
5) Commit the transaction.
From what I found to read here, and what I didn't found to read in the documentation, it would appear that step 3 (retrieving the auto-incremented key) is not supported in VFP 8.0, which I find hard to believe, to say the least.
If it is really the case, what is a concurrency-safe workaround ? Forgetting about autoincrement and writing all the auto-incrementing code by myself ?
Suivant
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