Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending to a database table with a unique primary key
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00259291
Message ID:
00259303
Views:
13
Hi Jeremy ---

Your problem is that with the APPEND BLANK, you are creating a record with a blank primary key (which may be duplicated elsewhere). I take it from your mention of m.groupid that you are using SCATTER/GATHER to move data around? If so, consider the following as a replacement:

INSERT INTO mytable (groupid) VALUES (m.groupid)
SELECT mytable
GATHER MEMVAR



>I have this database containing serveral tables. One of these tables is linked with all the other tables using a 1-m relation, via its primary key GROUPID. When I try to append blank to the parent table, the error 'Uniqueness of index GROUPID is violated' results. In the m.GROUPID memvar, I have a number that was not priorly used in that table. I tried to set deleted off and see if there were any other keys, but there were not. What should I do?
>Thanks any help.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform