Working with SQL Scripts - MapInfo_Pro - 2023

MapInfo Pro Help

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapInfo Pro
Version
2023
Language
English
Product name
MapInfo Pro
Title
MapInfo Pro Help
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:39:16.995549

When MapInfo Pro starts, it reads all .MBS files from the saved scripts' preferences location. You can load a .QRY or .MBS file from the SQL window.

SQL scripts are executed using "immediate" mode interpreted MapBasic and are not compiled.

As you insert, update, delete, or select statements using the SQL Select, Simple Select, Select By Location, Update Column, Add Rows, new scripts are added to the Recent list in the SQL list drop-down. Also, as you edit and update a SQL script using the SQL window, new point versions are added and grouped with the currently loaded script. They also appear at the top of the Recent list in the SQL list drop-down.

These scripts can be edited and run via the SQL window. In addition, a MapInfo Pro add-in can add or remove scripts from the collection using the object model. Integrated Mapping apps have access to the collection, as well.

When you click on the Scripts combo-box and hover your mouse over one of the scripts, you will see the following options:

Mark as Favorite

Click on the Mark as Favorite button to add your selected script to the Favorites list in the SQL drop-down list. Click again to toggle and Mark as Not Favorite.
Note: When an unsaved script is marked as favorite, it is saved and given its own group.

Save Script

To save a SQL script, click the Save Script button in the Scripts combo-box. A script cannot be saved unless it has a valid name.
Note: When an unsaved script is saved, it is given its own group.

Rename Script

To rename a SQL script, click the Rename Script button in the Scripts combo-box.

Delete Script

Click the Delete Script button in the Scripts combo-box to delete the selected script. If you try to delete a script that has been saved to a file, a confirmation dialog appears. Click OK to delete the script.

Reload Saved Script

For the currently selected script, the Reload Saved Script button makes a copy of what is in the script editor, then loads the script again from disk.

The SQL window uses the same font as the MapBasic window. To change the font press F8 when the cursor is in the MapBasic Window. Currently you cannot change the font directly from the SQL Window. It is persisted in a preferences file.