Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to check a table for duplicates???
Message
From
28/02/2002 15:25:17
 
 
To
28/02/2002 13:43:47
James Wade
Office of Criminal District Attorney
Edinburg, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00619081
Message ID:
00626643
Views:
20
Hello James,

The site did not remove those items...the browser did :) It thinks they are HTML tags--they are really still there, as 'view source' will reveal.

Anyway, enclose code in < PRE> and < /PRE> HTML tags (w/o the spaces) to preserve formatting.

>
>LOCAL cCNTID1, cCNTID2, cCMPID1, cCMPID2
>cCNTID1 = ""
>cCNTID2 = ""
>cCMPID1 = ""
>cCMPID2 = ""
>USE C:\MVS\MS_8021.DBF   && OPEN TABLE
>SET ORDER TO 3   && Indexed on CNT_ID - the field to check for duplicates
>SET TEXTMERGE TO C:\MVS\MS_8021DUP.TXT   && Open the text output file
>SET TEXTMERGE ON NOSHOW   && Turn on the textmerge capability w/o console output
>LOCATE    && GO TOP
>SCAN
>        *  Capture the values in the current record for comparison with the next
>	cCNTID1 = CNT_ID
>	cCMPID1 = CMP_ID
>	cRECORD1 = STR(RECNO(),5,0)
>	SKIP   && move to the next record
>	IF CNT_ID = cCNTID1  && make the comparison
>                * if values the same output the values from each record
>		TEXT
>			<<cRECORD1>> / <<cCMPID1>> / <<cCNTID1>> / <<STR(RECNO(),5,0)>> / <<CMP_ID>> / <<CNT_ID>>
>		ENDTEXT
>	ENDIF
>	SKIP -1   && move the record pointer back to previous record
>                  * because SCAN will do a skip forward to evaluate the next two
>ENDSCAN
>SET TEXTMERGE OFF
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform