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:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Inserts or updates a record in a table in one line.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
FM FMSQL | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
FileName | The file name of where the table is inside. Can be empty to look for the table in all files. | Get(FileName) |
TableName | 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. |
"Assets" |
IDField1 | The name of the field which provides an unique ID for each record, so we can identify the field. Can be ID of field, so we lookup name by ID. Can be result of GetFieldName() function as we remove table name automatically. |
"ID1" |
IDValue1 | The value for the ID field to identify the record. Data type of parameter must match the data type of the field. |
$RecordID |
IDField2 | The name of the field which provides an unique ID for each record, so we can identify the field. Can be ID of field, so we lookup name by ID. Can be result of GetFieldName() function as we remove table name automatically. |
"ID2" |
IDValue2 | The value for the ID field to identify the record. Data type of parameter must match the data type of the field. |
$RelatedRecordID |
IDField3 | The name of the field which provides an unique ID for each record, so we can identify the field. Can be ID of field, so we lookup name by ID. Can be result of GetFieldName() function as we remove table name automatically. |
"ID3" |
IDValue3 | The value for the ID field to identify the record. Data type of parameter must match the data type of the field. |
$OtherRecordID |
IDField4 | The name of the field which provides an unique ID for each record, so we can identify the field. Can be ID of field, so we lookup name by ID. Can be result of GetFieldName() function as we remove table name automatically. |
"ID4" |
IDValue4 | The value for the ID field to identify the record. Data type of parameter must match the data type of the field. |
$ForthRecordID |
IDField5 | The name of the field which provides an unique ID for each record, so we can identify the field. Can be ID of field, so we lookup name by ID. Can be result of GetFieldName() function as we remove table name automatically. |
"ID5" |
IDValue5 | The value for the ID field to identify the record. Data type of parameter must match the data type of the field. |
$FifthRecordID |
FieldName... | A field name to set. | "Model" |
FieldValue... | A field value to use for setting the field in the parameter before. Data type of parameter must match the data type of the field. |
"Test" |
Returns OK or error.
Update record with 5 identifying fields:
MBS( "FM.InsertOrUpdateRecord5";
""; "Contacts";
// 5 fields to identify record
"First"; "Christian";
"Last"; "Schmitz";
"Company"; "MBS";
"Title"; "Mr";
"Group"; "MBS";
// one field to set
"Fax"; "122345" )
Created 9th March 2021, last changed 5th June 2021
FM.InsertOrUpdateRecord4 - FM.InsertOrUpdateRecordQuery
Feedback: Report problem or ask question.