Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Terry Bottorff
  Where is Terry Bottorff?
 Cheyenne
 Wyoming - United States
 Terry Bottorff
 To: Eric den Doop
  Where is Eric den Doop?
 Houten
 Netherlands
 Eric den Doop
 Tags
Subject: RE: Primary Key
Thread ID: 22002 Message ID: 22076 # Views: 22 # Ratings: 0
Version: Visual FoxPro 7 Category: General VFP Topics
Date: Tuesday, April 08, 2003 2:35:31 PM         
   


> > If I have a table that has an integer field (ikey) and a character field (cname) and the integer field is the primary key. Is there a way in code to set the ikey field not to the primary key - append records - fill the ikey field with the appropriate key - set in code ikey back to the primary key? I know how to do everything but set the ikey field "not to a primary key field" and then "set it to a primary key field". TIA.
> >
> > Buffiie
>
> Hi Terry, is it an option for you to replace the key value of the records you want to append BEFORE appending them?
> --
> Eric den Doop
> www.foxite.com - The Home Of The Visual FoxPro Experts

I have written this Rodeo software and every rodeo has a New set of Cowboys that I get from the Professional Rodeo Cowboys Assoc. in a download. So what I really doing is recreating my data for every rodeo and I use the contestant number as a primary key that relates to tables of events they are in like Bare Back and Bull Riding. So I import the data but since I get to assign the contestant number I just want to import the data without a number to begin with and then assign it. Since I have the contestant number as a primary key I just need to turn if off - assign it and turn it back on. Boudewijn indicated that I could use Alter Table and I tried it and it worked. I am not sure that is the best way but I am thinking about putting in a cursor assigning and then putting in the table. I also recreate all of the child tables at the same time but since it is always New Data it really does not make any difference..... Thanks for your time. If you have any thoughts on Alter Table I would like to hear them.....
Buffiie

COMPLETE THREAD

Primary Key Posted by Terry Bottorff @ 4/7/2003 1:25:42 PM
RE: Primary Key Posted by Eric den Doop @ 4/7/2003 1:59:25 PM
RE: Primary Key Posted by Terry Bottorff @ 4/8/2003 2:35:31 PM
RE: Primary Key Posted by Eric den Doop @ 4/8/2003 2:59:05 PM
RE: Primary Key Posted by Terry Bottorff @ 4/8/2003 5:45:14 PM
RE: Primary Key Posted by Boudewijn Lutgerink @ 4/7/2003 2:49:50 PM
RE: Primary Key Posted by Terry Bottorff @ 4/8/2003 2:37:03 PM