Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UNIQUE Index Type takes into consideration of deleted record
Message
From
09/11/2005 00:27:02
Felix Serra
Campus Management Corp.
Miami, Florida, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
UNIQUE Index Type takes into consideration of deleted record
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01066679
Message ID:
01066679
Views:
62
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 
Next
Reply
Map
View

Click here to load this message in the networking platform