Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Creates records in FileMaker database for current recordset.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
SQL | 5.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
Command | The command reference number gained with SQL.NewCommand. | $Command | |
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. | "Assets" | |
FieldNames | A list of field names for the insert. Empty entries in the list are ignored. |
"Model" | |
IgnoreDuplicates | Available in MBS FileMaker Plugin 7.3 or newer. If 1, ignores duplicates or with 0 or by default reports error for duplicates. If duplicates are found, the function returns number of duplicates instead of OK. |
0 | Optional |
Returns number of duplicates, OK or error.
Insert records to FileMaker from SQL database:
#Create select command and run it
Set Variable [$Command; Value:MBS("SQL.NewCommand"; $Connection; "SELECT FirstName, LastName, Birthday, NumberOfOrders, TotalSales FROM Test")]
#Run it
Set Variable [$result; Value:MBS("SQL.Execute"; $Command)]
If [$result ≠ "OK"]
Show Custom Dialog ["Error: " & $result]
Else
Set Variable [$result; Value:MBS("SQL.InsertRecords"; $Command; Get(FileName) ;"SQLite fun"; "FirstName¶LastName¶Birthday¶NumberOfOrders¶TotalSales")]
Show Custom Dialog ["Records imported."; $result]
End If
#Cleanup
Set Variable [$result2; Value:MBS("SQL.FreeCommand"; $Command)]
Created 29th July 2015, last changed 18th May 2017
SQL.InsertOrUpdateRecords - SQL.InternalSQLiteLibrary.Activate
Feedback: Report problem or ask question.