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.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
SQL.Commit
Saves any changes and ends the current transaction.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| SQL | 2.6 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| Connection | The connection reference number gained with SQL.NewConnection. | $Connection |
Result
Returns "OK" or error message.
Description
Saves any changes and ends the current transaction.Use Commit method to write transaction changes permanently to a database. It commits the work of all commands that associated with that connection.
All changes to the database since the last commit are made permanent and cannot be undone. Before a commit, all changes made since the start of the transaction can be rolled back using SQL.Rollback method.
Examples
Run something in transaction:
$Command = MBS("SQL.NewCommand"; $Connection; “BEGIN TRANSACTION“
// run it
$result2 = MBS("SQL.Execute"; $Command)
// and free command
$result4 = MBS("SQL.FreeCommand"; $Command)
// create command
$Command = MBS("SQL.NewCommand"; $Connection; "some other SQL command here"
// run it
$result2 = MBS("SQL.Execute"; $Command)
// and free command
$result4 = MBS("SQL.FreeCommand"; $Command)
// create command
$Command = MBS("SQL.NewCommand"; $Connection; "some other SQL command here"
// run it
$result2 = MBS("SQL.Execute"; $Command)
// and free command
$result4 = MBS("SQL.FreeCommand"; $Command)
// commit changed
$result3 = MBS("SQL.Commit"; $Connection)
See also
- FM.SQL.InsertRecordsToSQL
- SQL.Execute
- SQL.FreeCommand
- SQL.InsertOrUpdateRecords
- SQL.NewCommand
- SQL.NewConnection
- SQL.Rollback
- SQL.SetParamAsContainer
- SQL.SetParamsWithJSON
- SQL.SetParamValues
Example Databases
- SQL to other databases/MySQL example
- SQL to other databases/SQL Export
- SQL to other databases/SQLite blob
- SQL to other databases/SQLite fun
- Third Party/FileMaker Snippet Storage
FileMaker Magazin
Created 18th August 2014, last changed 25th October 2018
Feedback: Report problem or ask question.
Links
MBS Xojo Plugins