Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting primary key after an insert
Message
 
 
À
08/06/2006 04:27:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01127217
Message ID:
01127828
Vues:
41
Aleksey,

>No, Michel, I am saying that, if you want to get the value back, you can execute GETAUTOINCVALUE(0) as a procedure after Insert. If you simply want to use the value in the subsequent Insert then you can use GETAUTOINCVALUE(0) in VALUES list of the INSERT command.

Is that code multiuser/multithread safe? I really don't see how getautoincvalue() can be used outside the context of a VFP stored proc. Also this function would seem to fail should the inserted table have an INSERT trigger which causes another autoinc field in another table to be consumed.

Similar to have to using scope_identity() rather than @@identity in SQL server.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform