Pack Table 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

Provides the functionality of MapInfo Pro's Pack Table command (on the TABLE tab, click Table). You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Pack Table table { Graphic | Data | Graphic Data } [ Interactive ] 

table is a string representing the name of an open table that does not have unsaved changes.

Description

To pack a table's data, include the optional Data keyword. When you pack a table's data, MapInfo Pro physically deletes any rows that had been flagged as "deleted."

To pack a table's graphical objects, include the optional Graphic keyword. Packing the graphical objects removes empty space from the map file, resulting in a smaller table. However, packing a table's graphical objects may cause editing operations to be slower.

The Pack Table statement can include both the Graphic keyword and the Data keyword, and it must include at least one of the keywords.

A Pack Table statement may cause map layers to be removed from a Map window, possibly causing the loss of themes or cosmetic objects.

If you include the Interactive keyword, MapInfo Pro prompts the user to save themes and/or cosmetic objects (if themes or cosmetic objects are about to be lost). This statement cannot pack linked tables. Also, this statement cannot pack a table that has unsaved edits. To save edits, use the Commit Table statement.

Note: Packing a table can invalidate custom labels that are stored in workspaces. Suppose you create custom labels and save them in a workspace. If you delete rows from your table and pack the table, you may get incorrect labels the next time you load the workspace. (Within a workspace, custom labels are stored with respect to row ID numbers; when you pack a table, you change the table's row ID numbers, possibly invalidating custom labels stored in workspaces.) If you only delete rows from the end of the table (for example, from the bottom of the Browser window), packing will not invalidate the custom labels.

Packing Access Tables

The Pack Table statement saves a copy of the original Microsoft Access table without the column types that MapInfo Pro does not support. If a Microsoft Access table has MEMO, OLE, or LONG BINARY type columns, those columns are lost during a pack.

Example

Pack Table parcels Data 

See Also:

Open Table statement