Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting primary key after an insert
Message
 
 
To
08/06/2006 04:27:02
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01127217
Message ID:
01127828
Views:
34
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform