Assuming you have a primary key in the "parent" table, then you should be able to export all records from the parents table, and import them to the "child" table.
The key is that when you import to the new table, you need the primary key of "parent" imported to the foreign key of "child" to establish the relationship.
The script for this could really just be as simple as:
Set Variable [ $file ; "file:" & get(temporarypath) & "temp.fmp12" ]
Export Records [ $file ; filemaker format ; specify fields ]
Go to Layout [ child ]
Import Records [ $file ; filemaker format ; specify fields ]
Do you have a proper unique primary key in the parent table, as well as a corresponding foreign key in the child table that makes up the relationship?
Also post a screenshot of your script in the future, so we can better assist.
You might consider this option (Make back up copies first in case it doesn't produce the results you want):
Find the records either manually or via a script to produce a found set of the desired records.
Use Import Records to import that found set into your separate table.
- Find the records in the source table
- Go to a layout of the target table
Make sure to check the table occurrence of the layout where you performed the find (go to Layout mode and take note of the name next to 'Table:'); that is the name you must select in the Import dialog on the 'Source' side.
At that point, the two tables don't have to be related; in fact, often child records are created by this method. For this, you must not forget to map the foreign key of the import table to the primary key of the export table.
a son database
The common term for the many-side in a ine-to-many relationship is (the gender-neutral) 'child table'.