Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving an auto-incremented value
Message
De
29/09/2004 07:48:57
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Retrieving an auto-incremented value
Divers
Thread ID:
00947113
Message ID:
00947113
Vues:
56
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
Fil
Voir

Click here to load this message in the networking platform