Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AutoInc question
Message
From
27/02/2003 03:21:42
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00757141
Message ID:
00758618
Views:
13
Hi paul,

>I was thinking about using the AutoInc functionality in some of my apps (instead of the standard NewID() function). Maintaining the ID table is a bit of a hassle when doing updates. Anyway, I haven't figured out how I can get the next ID value being inserted into the table from a view. For example, I have AutoInc on a table, and have a view that uses this table. I add new record to this view and need to use the new record's PK as a FK in another view before doing the update. How do I do this? Unfortunately, this isn't covered in the new Hentzenwerke book on VFP 8 either. :-(

About ten months ago, I warned people to get too enthousiastic about this auto increment feature. In Re: News scoops from EssentialFox Thread #649984 Message #655411 I wrote:

I am only trying to warn that the autoincrementing feature might not be what people think it is, and that they will be faced with problems that did not occur with custom generated keys. If it is just implemented as a counter in the tableheader, which is assigned when a record actually is written to the table (like in other DBMSs), I fear the worst....because people are going to use it, and will be faced with problems that are not easy to solve.

I did describe your very same problem in this thread.

The problem is that at first glance it seems a neat feature, but at second glance you'd better stick with your custom PK generator, especially when using views in parent and child relations. Many people have requested the feature, just because: "its available in all RDBMS, why not in VFP?". The VFP team has implemented it, but IMO it should have been left. I don't see many advantages in having this auto-incremeneting feature, I do see many disadvantages.

Oh, yeah. The autoincrementing thing is not a part of the relation model described by Date and Codd, so not having this feature is not any measure of VFP beeing a (R)DBMS at all.

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform