Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieving an auto-incremented value
Message
From
29/09/2004 08:08:17
 
 
To
29/09/2004 07:48:57
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00947113
Message ID:
00947119
Views:
15
Hi David,

VFP9 will have a new Getautoincvalue() function, so you must wait a few months.

>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 ?
Previous
Reply
Map
View

Click here to load this message in the networking platform