Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AutoInc question
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00757141
Message ID:
00758840
Views:
17
>It would have been nice to have had a new VFP command added to prefetch the next key

Why, you can't do this in SQL server.

>and/or when a new record is added to a view that the PK is automatically passed forward into the view.

Why, this doesn't happen with a remote view to sql server if using identity keys. (Though not for lack of asking for this feature.)

>It would have also been nice to be able to overwrite the existing PK via a view, so that it wouldn't require any changes in my existing views to support it.

I don't know what you mean. You want to be able to change the PK value?

>I guess the thing that bothers me about have to look at the underlying table after adding a new record via a view is that it feels like I need to know way too much about the source of data for my view.

Nope, you can do this generically. You can use CursorGetProp("KeyFieldList") to get the PK field of the view and use that to get its value to put into your views PK field.

********
All the above is just like using Identity fields in SQL server. Except that there is no scope_identity() function, which would be a nice addition, but isn't 100% needed.


>Then I either have to have them manually add a new record into my ID table, or write some code that does it for me. Hmm...Maybe I'll just modify my update app. to check/update the ID table for me, and be done with it.

Duh, that how our sp_NewID() proc we use in SQL server works. If the table name passed isn't specified it adds that to the key table. Currently, we assume it is the first access, but you could add code to get the max ID from the table and use that as the seed.

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform