Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check duplicate in table buffered mode?
Message
 
To
19/10/1997 01:52:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00055264
Message ID:
00055360
Views:
27
>>>>How do I check for duplicate in table buffered mode? Do I have to do a 'COPY TO' a temp table before I check? It seems troublesome.
>>>>
>>>>This table buffering is really killing my time. Can someone please comment?
>>>
>>>This is an interesting situation. I don't think a COPY TO is good as it will slow down the process on big tables. Are candidates keys useful in this situation? This process may be handle by Visual FoxPro automatically using that. Or, if from a manual process, then I would check for all modified records in comparism with the rest of the table.
>>>
>>>There is certainly other techniques. Those are just the first ones that came to my mind.
>>
>>I am puzzled. Isn't this a basic thing everyone using VFP will encounter? How do you people normally handle duplicate key in table buffer mode? Using the candidate key? The second method sounds like quite a chore.
>
>As for checking duplicates, I am calling a function for that which will seek to see if a value already exist for that field other than the current record we are presently on. However here, some special considerations may apply because you are using table buffering which means several new records may have been created but not on disk yet.

Hi guys,
just another idea to the forum. I have a table, what users work with. I created another one small table with fields internal_ID, user_ID that are in base table too. Internal_ID is given by system as a result of default value, user_id is ID given by user. And in insert trigger I wrote a small procedure that inserts one record into the small table with the value of INTERNAL_ID. In update trigger I havve another small routine that seeks for internal_id and user_id in the second table. If !found() = error. If found() duplicate user_id with different internal_id = error and don't let the user update table.
hth
Dezider
There were three worst disasters in the history of human
race in 20-th century:
1, Hiroshima 44
2, Tchernobyl 86
3, Windows 95
Previous
Reply
Map
View

Click here to load this message in the networking platform