Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UNIQUE Index Type takes into consideration of deleted re
Message
From
09/11/2005 08:11:37
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
09/11/2005 00:27:02
Felix Serra
Campus Management Corp.
Miami, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01066679
Message ID:
01066734
Views:
20
As far as I know, there is no practical use of unique indices.

>Unique Index Type takes into consideration of deleted records.
>Below is a program that will duplcate this problem. What happens is if you have duplcated records that are deleted, as in this example, when you order the table by the index, you will not see any records pertaining to these records. This is due to FoxPro, even with SET STEP ON, takes these deleted records as if they were not deleted.
>
>
>
>
>** Test program for UNIQUE Index problem
>CLOSE TABLES ALL
>CLEAR ALL
>SET DELETED ON
>
>
>IF FILE('UNQTBL.DBF')
>	DELETE FILE UNQTBL.DBF
>ENDIF
>
>
>CREATE TABLE UNQTBL (TRMCODE C(4), COURSE C(7), SECTION C(2))
>
>INSERT INTO UNQTBL VALUES ('1234', 'ACC101', '01')
>INSERT INTO UNQTBL VALUES ('1234', 'ACC101', '01')
>INSERT INTO UNQTBL VALUES ('1234', 'ACC101', '01')
>
>&& This will delete the first two identical records and leave
>&& the last record visible.
>GO TOP
>DELETE
>SKIP
>DELETE
>
>INDEX ON TRMCODE + COURSE + SECTION TAG UNIQREC UNIQUE
>&& Actual results show no records due to the prior deleted duplicate data
>BROWSE
>
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform