Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updateable views and autoinc
Message
From
24/01/2007 12:51:08
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01176384
Message ID:
01188825
Views:
20
If I'd were in your shoes I'd do the following

- Junk the autoinc integers, just make them integer.
- Create a newkey stored procedure that will create a new key and store the latest value in a dedicated key table .
- Set the default value for the PK as Newkey('') (fill in the name of the field)
- Also use the newkey function in your view definitions.
- You can call the newkey function everywhere in your app.

Still a bit of coding to do I guess, but better than switching to GUID's

Walter,


>>Hi Mike,
>>
>>>GUIDs are bigger than integers and are not the fastest choice.
>>
>>That's what we mostly use, too. Aside from making it easier on the middle-tier or client side to deal with new keys, GUIDs also have the advantage of supporting replication and disconnected scenarios. They are also more scalable because you don't need obtain a lock on a resource that increments a key, whether the resource is a SEQUENCE, an AutoInc field, a stored procedure, or whatever.
>
>I think in the next application I will rather use GUID as well. But is there a solution for my current problem?
>
>Thanks in advance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform