Using Templates for Queries - 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

Query templates enable you to save Select or SQL Select statements as templates and reload them. This saves you the trouble of having to rebuild a query each time you want to use it. Both the Select and SQL Select dialog boxes have Load Template and Save Template options to enable you to do this easily. Query templates are useful for re-creating a query with an updated version of the table used in the original query, or for executing a query on a table that has the same fields as the table on which the query statement was created.

Loading a Template

You can load any saved query template.

To load a query template:

  1. In the Select or SQL Select dialog boxes, lick the Load Template button. The Load Dialog From Query File dialog box displays. It lists the .QRY files.
  2. Select the .QRY file you want to use, and click Open. The Select or SQL Select dialog box displays with the values from the template already filled in. Simply execute your query to create the query browser.

Renaming a Template

Rename a template by selecting and clicking the template name; enter a new name up to 64 characters.

Saving a Template

After you have finished writing your Select or SQL Select query, you can save the query as a template.

To save a query as a template:

  1. In the Select or SQL Select dialog boxes, click the Save Template button to save the query to a template, or query file. The Save Dialog to Query File dialog box displays.
  2. Give the query file a name, select a folder, and click Save. Query files are saved with a .QRY extension and are saved in the directory specified in the Directories preferences.
Note: The query does not need to be complete or syntactically correct to save it to a template.

Deleting a Template

To delete a template:

  • Select the template name and press the Delete key. A dialog box displays prompting you to confirm or cancel the operation. If no templates of the given type exist, a button to restore a default template displays.