Rollback 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

Discards a table's unsaved edits. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Rollback Table tablename 

tablename is the name of an open table.

Description

If the specified table has been edited, but the edits have not been saved, the Rollback statement discards the unsaved edits. The user can obtain the same results by choosing Revert Table command, except that command displays a dialog box.

Note: When you Rollback a query table, MapInfo Pro discards any unsaved edits in the permanent table used for the query (except in cases where the query produces a join, or the query produces aggregated results, for example, using the Select statement's Group By clause).

For example, if you edit a permanent table (such as WORLD), make a selection from WORLD, and browse the selection, MapInfo Pro will "snapshot" the Selection table, and call the snapshot (something like) QUERY1. If you then Rollback the QUERY1 table, MapInfo Pro discards any unsaved edits in the WORLD table, since the WORLD table is the table on which QUERY1 is based.

Using a Rollback statement on a linked table discards the unsaved edits and returns the table to the state it was in prior to the unsaved edits.

Example

If keep_changes Then
	 Table towns
Else
	Rollback Table towns
End If 

See Also:

Commit Table statement