Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Seeking a brilliant idea to replace NextID() function
Message
De
22/01/2008 05:57:58
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
22/01/2008 01:40:09
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
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
Database:
MS SQL Server
Divers
Thread ID:
01283680
Message ID:
01283931
Vues:
15
>>>>>Check Message #1111814
>>>>
>>>>I checked, probably brain dead now, can't see how it helps to know the key before inserting a new record.
>>>>Cetin
>>>
>>>I'm thinking there is no way to achieve your goal. You need to insert a record in order to get the ID. You can not get the ID without inserting.
>>
>>Why? I can do that with native tables and using a GUID as a key. There should be a way with int too, just not found yet:)
>
>Convert your GUID into 4 or 8 integers ;).

Hey Dragan,
You're up to something:) (you can tell it to aunt Mary) I started to think I could create a function that generates 32 bit CRC value from a GUID. Any randomization would do. Using an auxillary GUID column as the real PK on every table and enforcing uniqueness on this field I can come up with a working solution:)
Currently leaning through another idea from Suhas keeping a GUID-int allocation pair.

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform