Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What happened?
Message
From
05/04/2000 11:26:19
 
 
To
05/04/2000 10:13:42
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Stonefield
Title:
Miscellaneous
Thread ID:
00355658
Message ID:
00355720
Views:
13
Hi Calvin,

>Can someone please tell me what happened under the following senerio:
>1.On a stand alone test machine when running the stonefield repair program I received an error message 'Primary key violation' or something to that effect.
>2.On my development machine, using the same data, I was able to use the table and examine it for duplicate records. I did not find any.
>3.I then on the development machine ran the app and ran the stonefield repair program. I got the same message as in #1 above.
>4 When I returned to the command window I dropped the table from the DBC and browsed it. The table is toast- there is garbage and what date there is is offset.
>
>Any help greatly appreciated.
>By the way, what does one do to fix a primary key violation that is already in the table???

Couple of ideas based on my experience (read stupid antics < g > )
Make sure you have deleted set off.
Run a SQL query like:
Select mytable.key_ID,count(*) as cnt from mytable group by 1 having cnt > 1
That will hopefully point out which key_id(s) are duplicated. Then use the table with no order. Go to top of table and execute a LOCATE FOR key_id = the offender. In our case, since the key_ID's are assigned sequentially, you will find the first instance of that key in its appropriate place. Then execute a CONTINUE command and hopefully you will land on the second instance of that key but in this case, it will NOT be in sequence and, you can probably tell what the correct id should be. Correct the id and repeat the process until your query comes up blank.

One other thing... if you attempt a reindex without first correcting the primary key problem, the indexing will stop at the primary key and you will lose the other indices.

Hope this helps,

Ken
Previous
Reply
Map
View

Click here to load this message in the networking platform