Simplicty and flexibility!


SEQUENCE COMMAND


Started by Bryan Luckock
Search
You will need to Sign In to be able to add or comment on the forum!

SEQUENCE COMMAND

Previous versions of Dataease had a "sequence" command which I found extremely useful. I note that in v 8.5 this has been replaced by "unique". This new function doesn't work for me and the way in which I need to use it.

How can I replicate the "sequence" command so that I can give each record a unique 5 digit number with the first record commencing with 00001 and the next record 00002 etc.


Written by Bryan Luckock 12/10/17 at 22:19:19 Dataease [{8}]FIVE

Sequence vs UNIQUID()


Hi Bryan.

I am glad to be able to tell you that you are mistaken.

Sequence is alive and well.

Sequence has in a way been the "only" way to insure uniqueness in DataEase and it is not a good method for that. However it is a brilliant method for creating a sequence.

It has been re-visited many times over the year as it has never been perfect. Originally it simply allocated you a number in the sequence when you requested it which left holes in the sequence if the  user aborted which is "Illegal" if you use it for Invoice Numbers etc.

The current implementation work with "Hindsight" i.e. you get allocated the next sequence number when you start entering the data but it gets reallocated to the correct number - if someone has saved records in the meantime - which insure the sequence is correct but it is quite "anoying" if you use the sequence number as part of any third party processing like a DQL or as part of a concatenated field for indexing etc.

UniquID() was created so a record can get a guaranteed unique ID (completely unique in the database and even in the world of DataEase!) which a sequence can sadly not offer. It was created as an necessary addition and a proper unique key rather than as a replacement for Sequence.

In DFW the sequence "command" has been made into a field type called Sequence ID.

If you try to type sequence from into a Numeric String field it will automatically be converted to a Sequence ID field, but if you write it into a text field it will work as in the old days:

Sequence from "A00001" 

This will count A00001 to A99999 and then B00000 etc.


Written by DataEase 13/10/17 at 10:25:43 Dataease [{8}]FIVE
DG3_ForumList