Server Commit statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Causes the current unit of work to be saved to the database. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Server ConnectionNumber Commit

ConnectionNumber is an integer value that identifies the specific connection.

Description

The Server Commit statement makes permanent the effects of all remote SQL statements on the connection issued since the last Server Begin Transaction statement to the database. You must have an open transaction initiated by the Server Begin Transaction statement before you can use the Server Commit statement. Then you must issue a new Server Begin Transaction statement following the Server Commit statement to begin a new transaction.

Example

hdbc = Server_Connect("ODBC", "DLG=1")
Server hdbc Begin Transaction
hstmt = Server_Execute(hdbc, "Update Emp Set salary = salary * 1.5")
Server hdbc Commit

See Also:

Server Begin Transaction statement, Server Rollback statement