Components Crossplatform Mac & Win Server Client Old Deprecated Guides Examples Videos
New in version: 11.2 11.3 11.4 11.5 12.0 12.1 12.2 12.3 12.4 12.5 Statistic FMM Blog
Inserts a lot of records queried from a database.
|FM FMSQL||5.1||✅ Yes||✅ Yes||✅ Yes||✅ Yes||✅ Yes|
|InsertFileName||The file name of where the insert table is inside. Can be empty to look for the table in all files.||Get(FileName)|
|InsertTableName||The name of the table to insert record into.
Can be ID of table, so we lookup name by ID.
Can be result of GetFieldName() function as we remove field name automatically.
|FieldNames||A list of field names for the insert.
Empty entries in the list are ignored.
Can be ID of field, so we lookup name by ID.
Can be result of GetFieldName() function as we remove table name automatically.
|QueryFileName||The file name for the database to run the query against. Can be empty to look for the table in all files.||Get(FileName)|
|SQL Statement||SQL Statement as a Text string|
|Params...||Pass here parameters.
One parameter to this function for each parameter you want to pass to the SQL statement.
Returns OK or error.
DescriptionInserts a lot of records queried from a database.
This function allows to easily copy a lot of records from one table to another table.
Copy can be from one database to other or within same database. Also from one table to other or within a table. Due to passing in new field names, you can even rearrange values from one column to other while copying. In the SQL you can use functions for sums or join data from several tables together to fill a new table. Filename parameters can be empty.
Use FM.ExecuteSQL.LastErrorMessage and FM.ExecuteSQL.LastError to see error message.
Reports an error if field name list doesn't match column count of the query result.
Please do use field names of global or unstored calculated fields in the FieldNames list.
For inserting records from other database (e.g. MySQL), please use SQL.InsertRecords function.
Using FM.SetSQLBatchMode you can let the plugin insert e.g. 50 rows in one chunk which can speed up insert a lot.
Due to memory usage it can be useful to segment copy queries to only copy one GB at a time and avoid heavy memory pressure.
With plugin version 7.2 or later, you can specify fields and table via IDs and the plugin will lookup them for you at runtime. Table IDs and table names must be unique across all open files for this to work correctly.
With plugin version 8.4 or newer, you can use GetFieldName() function to query field names and the plugin removes the table prefix with :: in the field name before passing it to SQL engine.
Please don't overload the function, so better work in blocks of e.g. 1000 rows at a time.
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.
Please repeat Params parameter as often as you need.
Copy records within one table in same file:
Copy records from a table from one database to other (production to development)
Copy data to other table:
Query sum of sales grouped by customers in a sales report table:
Copy two fields from one table to other:
Copy from Anlagen example (in German) to copy of same file:
Copy data to other table with parameter:
Copy from file to fill clone with order and two fields to filter:
Import records and add Import ID field with constant value:
- Dynamically build MBS call and evaluate it
- MBS FileMaker Plugin, version 6.2pr3
- MBS FileMaker Plugin, version 6.0pr7
- MBS FileMaker Plugin, version 5.4pr5
- MBS FileMaker Plugin 5.1 for OS X/Windows
- MBS FileMaker Plugin, version 5.1pr7
- Quickly copy lots of records
Created 29th April 2015, last changed 15th October 2021
Feedback: Report problem or ask question.