February 10, 200916 yr I need to re-serialize (using Replace Field Contents) a few of my primary key serial IDs (Indexed, Auto-Enter Serial, Can’t Modify Auto). Each primary key has a foreign key equivalent in another table. If I re-serialize the primary keys, will the foreign keys automatically be filled in, or is there some process/command that I can use to fill them in so that I don’t have to do it manually? I guess I want to re-serialize the primary keys and somehow sync their respective foreign keys so they match up. Not sure if I’m asking this the right way. I hope you can help. TIA lpm WinXP FM9Adv
February 11, 200916 yr If I re-serialize the primary keys, will the foreign keys automatically be filled in No. You need to do this in stages: first, create and populate a NEW primary key field in the parent table; then, using the existing relationship/s, populate a new foreign key field in the child table/s with the parent value. Finally, switch the relationship/s to use the new fields and delete the old ones. Having a backup is strongly recommended.
February 12, 200916 yr Author I think I’m beginning to understand this better, but not totally. …“populate a NEW primary key in the parent table” I’m assuming I populate the new primary key field by re-serializing it (replace field contents). …“populate a NEW foreign key field in the child table/s with the parent value” This is where I am having difficulty understanding. Do I populate the new foreign key fields by manually/individually entering the parent values in the foreign key field in each record or by some other process? I’m almost there… Thanks for your patience.
February 12, 200916 yr [color:green]I’m assuming I populate the new primary key field by re-serializing it (replace field contents). Sure. But be sure to 1) show all records first and 2) be sure no Users are in the system which might lock a record (which would keep the serial from setting). Then, be sure to check the checkbox 'Update Serial in Entry Options' and of course, back up first. [color:green] “populate a NEW foreign key field in the child table/s with the parent value” Go to your child table. You already have a good relationship between parent and child (based upon the ID, right?). So those children know who their parents are. Create a new parent ID field in the child. Show all records and set the new parentID with: Parent::newParentSerial (again using Replace Field Contents when no Users are in systems.) But why do you need to reserialize SOME of your records? If you need to reseralize them, doesn't this indicate that your primary (regular) relationship is broken? If so, then this reserializatios process will not work. Please clarify why you need to reseralize SOME of your records (and their children). If the relationships are broken then you need to determine what information in both tables can be concatenated to temporarily re-create a proper match first. LaRetta
Create an account or sign in to comment