Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides
New in version: 5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2    Statistic  


Inserts records in SQL database from records in memory.

Component: FM FMSQL SQL
Version: 6.4
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: Yes

MBS( "FM.SQL.InsertRecordsToSQL"; SQLref; Connection; InsertTableName; FieldNames { ; StartRow; EndRow; Replace } )


Parameter Description Example value
SQLref The reference number returned by FM.SQL.Execute function. $SQLRef
Connection The connection reference number gained with SQL.NewConnection. $Connection
InsertTableName The name of the table to insert record into. "Assets"
FieldNames A list of field names for the insert.
Empty entries in the list are ignored.
StartRow Optional
The index of the start row.
First row is 0.
EndRow Optional
The index of the end row.
First row is 0. Last Row would be FM.SQL.RowCount-1.
Replace Optional
Available in MBS FileMaker Plugin 7.1 or newer.
Set to 1 to replace existing entries.
Currently available for MySQL and databases with same syntax.


Returns OK or error.


Inserts records in SQL database from records in memory.
This function allows to easily copy a lot of records from a query in FileMaker database into a SQL database.
Please provide field names in other table. The order has to match those in the record set.
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.
Reports an error if field name list doesn't match column count of the query result.
Function will fail if data types in source and dest fields do not match for assignment. e.g. date and time fields will not work, only timestamp fields.

For insert within FileMaker, please use FM.SQL.InsertRecords.


Insert Records to SQL database:

Set Variable [$InsertResult; Value:MBS( "FM.SQL.InsertRecordsToSQL"; $Records; $connection; $BaseTableName; $FieldNames)]

See also

FM.SQL.InsertRecords   -   FM.SQL.Release

Feedback: Report problem or ask question.

MBS Realbasic PDF Plugins - Bilder aus Nickenich