Re: ​Re: Preventing Duplicate Data WAS UUID vs Longint primary key

2017-08-07 Thread David Adams via 4D_Tech
I've found that after hours "helper" routines that fire off and run in the > background working through data to flag dupes for admin oversight next day is > popular with some managers who prefer to make their own decision about whether > some stuff really is a dupe or not. Some duplicate data has t

​Re: Preventing Duplicate Data WAS UUID vs Longint primary key

2017-08-07 Thread steve simpson via 4D_Tech
On Mon, Aug 7, 2017 at 3:00 PM, ​ ​ David Adams wrote: > > > > How do you deal with that problem (Preventing duplicate data) > Definitely ​ "Carefully program your system to detect and prevent duplicate rows" as appropriate. Generally such a Dupe Check can take many forms depending on the busine

Re: Preventing Duplicate Data WAS UUID vs Longint primary key

2017-08-07 Thread David Adams via 4D_Tech
As a variant on John's technique, I'll combine fields into a single text block that I then run through a fast hashing algorithm that returns a longint. What good is that longint? It helps in two cases: * If you're comparing two copies of the same record during an update/sync, etc., then you can h

Re: Preventing Duplicate Data WAS UUID vs Longint primary key

2017-08-07 Thread Jody Bevan via 4D_Tech
John: Thanks for sharing this. I had not thought of this way after all these years. I will take the idea and apply where appropriate, in addition to my normal code to reduce duplicates. Jody Bevan ARGUS Productions Inc. Developer Argus Productions Inc.

Re: Preventing Duplicate Data WAS UUID vs Longint primary key

2017-08-07 Thread John Baughman via 4D_Tech
What I have done is to have a field in the table that contains the keys that make the record unique with all spaces, special characters, and vowels removed, as well as eliminating any consecutive consonants . See my example below. So far this has worked pretty well for me and I guess would fall

Re: Preventing Duplicate Data WAS UUID vs Longint primary key

2017-08-07 Thread Chuck Miller via 4D_Tech
perhaps you can use sounded and store that in a hidden field. Regards Chuck Chuck Miller Voice: (617) 739-0306 Informed Solutions, Inc. Fax: (617) 232-1064 mailto:cjmillerinformed-solutions.c

Preventing Duplicate Data WAS UUID vs Longint primary key

2017-08-07 Thread Dennis, Neil via 4D_Tech
> How do you deal with that problem (Preventing duplicate data) When unique data is required because of a business need, I do implement one of your suggested methods: "Carefully program your system to detect and prevent duplicate rows." I would suggest not doing this in a trigger, but instead o

Re: ​Re: UUID vs Longint primary key

2017-08-07 Thread David Adams via 4D_Tech
Since it sounds like pretty much everyone uses UUIDs for links (me too, although I may not have an actual arrow drawn), maybe se can turn this thread in a different direction? Given that random synthetic keys do nothing to avoid duplicate rows - and may actually make duplicate rows more likely - wh

Re: ​Re: UUID vs Longint primary key

2017-08-07 Thread Charles Miller via 4D_Tech
It might be my memory, but I do not think that is how it worked in the beginning I was working on relational model dbs before SQL was a language Rdb at DEC for example. That was one of the ket differences between model types how you created and maintained the relations. I do not believe that th

​Re: UUID vs Longint primary key

2017-08-07 Thread steve simpson via 4D_Tech
On Mon, Aug 7, 2017 at 11:51 AM, < ​ <4d_tech-requ...@lists.4d.com> ​ npden...@greatext.com> wrote: > > ​[snip] > > On the other hand, you do model the data after business relations, but the > keys that tie that relation data need/should never be seen in a well > designed system. If a user readabl

Re: UUID vs Longint primary key

2017-08-07 Thread David Adams via 4D_Tech
> "Yes, use UUIDs in a 4D context rather than SeqNos. And, by the way, the way 4D implemented these > UUIDs - I don't approve with it." Not really. The difference between sequence numbers (your own or 4D's) and UUIDs isn't something I addressed. Don't care. Whatever is better in your system - con

Re: UUID vs Longint primary key

2017-08-07 Thread Marcus Straßmann via 4D_Tech
David, in short, you are answering the OP's question as: "Yes, use UUIDs in a 4D context rather than SeqNos. And, by the way, the way 4D implemented these UUIDs - I don't approve with it." Fine :-) Marcus MacStrass - Marcus Straßmann Softwareentwicklung und Beratung Auf der Markscheide 35 D-

Re: Thinking about optional parameters and optional object elements

2017-08-07 Thread Jeremy Roussak via 4D_Tech
Yes, yes, yes, yes, yes! structs are the single biggest thing I missed when coming to 4D from C; and I still miss them. Objects are not a substitute, nice and useful though they may be. Jeremy Jeremy Roussak j...@mac.com > +1,000! I was fighting for structs for months over on the Forums bef