1 Reply Latest reply on Sep 25, 2014 8:55 AM by philmodjunk

    Importing fields from one DB to another



      Importing fields from one DB to another


      I have two databases, call them Full and Subset.

      Without getting into complicated and unimportant background explanations, when it was created Subset had been simply export of part of part of Full--i.e. I did a Find to isolate certain records I needed (about half of Full), exported the results as another database, then trimmed down the fields, going from 33 down to four, adding one additional field that Full does not have.

      In short, I trimmed a couple of fields too many. I need to add back two more fields that are still in Full but were removed (months ago) from Subset. I can't simply replicate creating Subset: there are a lot of records since added to Full that I don't want in Subset (and can't isolate by filtering Full) and records removed from Subset that remain in full.

      The only way to get what I need is to import the two fields from Full into Subset, making sure that I only import the contents of matching records. To make sure it's accurate, I think I need to match three fields in each--the three fields that both databases still share. That is:

      FULL.................................................................. SUBSET

      Record 1.............................................................Record 1

      Field 1--------------------matches------------------->Field 1

      Field 2--------------------matches------------------->Field 2

      Field 3--------------------matches------------------->Field 3

      Field 4

      Field 5

      Field 6--------------------import-------------------->Field 4 (new to Subset)

      Field 7--------------------import-------------------->Field 5 (new to Subset)

      Field 8


      Of course, that's only if the records on Full and Subset match; if Record 2 exists in Full but not in Subset, nothing happens. A complication, as I see it, is that the matches won't be consecutive. Even sorted, the first records in each database might match, but then record 6 in Full might match record 2 of Subset.


      Any thoughts? Any clarifications I need to make in the question?

        • 1. Re: Importing fields from one DB to another

          there are a lot of records since added to Full that I don't want in Subset (and can't isolate by filtering Full)

          Given the many different ways that you could do that, that seems very unlikely.

          and records removed from Subset that remain in full.

          Which would mean that these records would also have to be omitted from the found set before you attempted an "import from scratch".

          So I'm unconvinced that what you want is "the only way".

          But a simple Import Matching Records of Found set should enable you to get what you want.

          a) Make a back up copy of your file just in case.

          b) add the new fields to SubSet if you have not already done so.

          c) go to a layout for SubSet and Show All records.

          d) Select Import Records | File from the File Menu and work through the dialogs to select the file and table from which you will import this data (You use the same steps even when both source and target tables are in the same file.)

          e) in the import records dialog, select the "Update Matching Records in Found Set" option. Do NOT select the "add remaining data as new reords" option.

          f) set up your field mapping and select fields 1, 2 and 3 as your matching fields.

          g) import your records

          Caulkins Consulting, Home of Adventures In FileMaking