Simplicty and flexibility!


New Function in 8 - UniqueID() - Returns a "Random" Unique ID as Key for a Record (Ver 8.0.0.1139)

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

New Function in 8 - UniqueID() - Returns a "Random" Unique ID as Key for a Record (Ver 8.0.0.1139)

One of the most popular and frustrating functions or should we rather say functionalities in DataEase is "Sequence from". Basically this is a "guaranteed" sequence number, and it is great when you need records to be in sequence and have a unique number. Problem is that if to people register data in the same table at the same time, the Sequence number you get when you start typing into your record, might not be the one the record ending up having when it is saved. The Sequence number you get when you start registering is the highest available at that time, and the same goes when you hit save, but in the meantime someone else might have saved a record and the next available is hence one higher, or many numbers higher. The uniqueness and the sequence is preserved, but if you have use the Sequence number to derive, link etc..you are in the sh....t. The truth is that in most cases where we use Sequence From, we are simply looking for a unique key and not a sequence, so wouldn't it be better if we had a true Unique Key generator? In PRISM 9 (The next prism version after this) all records will have an automatic unique ID, but for now we must do it manually. Enters: UniqueID() which returns a 16 character long guaranteed unique Key. The result will look like this: B40EHNT8Q92445WX or 953V8Z0IOV9NB5JZ etc. Make sure your Unique field is 16 characters long and text, or you might find that it is not unique after all ;-)
Written by DataEase 01/10/12 at 07:42:05 Dataease [{8}]FIVE

Re:New Function in 8 - UniqueID() - Returns a "Random" Unique ID as Key for a Record (Ver 8.0.0.1139)

Am I right in stating that this function replaces the Set/Get Uneek CDF? And is it right to assume that this unique id can be used to retreive records etc? thanks
Written by Josef Vella 11/10/12 at 12:39:01 Dataease [{8}]FIVE

Re:Re:New Function in 8 - UniqueID() - Returns a "Random" Unique ID as Key for a Record (Ver 8.0.0.1139)

Hi! This is simply a function that genearte a "guaranteed" unique ID that one can use as one please, but the short answer to the question is... Yes! In PRISM 9, and ID like this will be an integral part of the database design, but till then you will need to add this key by using the function and save the resulting key in a text field 16. You can of course then use it to retrive and relate the record ;-)
Written by DataEase 11/10/12 at 12:49:33 Dataease [{8}]FIVE
DG3_BlogList