Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Uniqueness of key violated problem...
Message
 
To
11/05/1997 20:07:28
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00031721
Message ID:
00031729
Views:
44
>>Hi,
>>
>>I'm having some trouble attempting to APPEND or INSERT INTO a table contained in a DATABASE. The table has a primary key and I've deleted some of the previous records and then when I attempt to add new ones that might have the same key as some of the deleted ones, I get the UNIQUENESS OF KEY VIOLATED error. I believe DELETED is set off. The only way I can get this to work is to PACK the table, but then I have to open it exclusivly, and that poses some problems sometime.
>>
>>Has anyone delt with this before in a good way?
>>
>>Thanks
>>
>>Jim
>
>How do you create the key? How do you insure is unique?
>
>Vlad

I'm using SUBSTR(SYS(2015), 3, 10) which generates a unique procedure name based on the system date and time. This way, if you're looping on a fast machine, the name will be unique. I guess the problem comes when I have a set of records in table_a, copy them to table_b, delete them from table_a, modify delete/add/modify the data in table_b and then append/insert it back into table_a. Maybe I need to find a better way to process this.
Jim Huenergardt
AXIO
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform