Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updateable views and autoinc
Message
De
24/01/2007 12:51:08
Walter Meester
HoogkarspelPays-Bas
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01176384
Message ID:
01188825
Vues:
22
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform