MapInfo Pro

  • 1.  The new SQL Splitbutton

    Posted 02-12-2020 21:04

    Over the coming weeks, I'll write a #series of articles about the #SQL improvements we have made in MapInfo Pro v2019. This will, of course, look at the Select statement, we will get there eventually, but I'll also dive into the other improvements.

    In this article, we'll dive into another of the improvements we made to the user interface: The new SQL Splitbutton.

    The new SQL Splitbutton

    Many of you might think that the SQL support in MapInfo Pro is the Select statement behind the SQL Select dialog. But SQL is actually a lot more than that. It's also inserting, updating and deleting records - and to this, you can even add the capabilities around modifying the table structure too.

    We have in MapInfo Pro v2019 gather many of the SQL features in one place: The SQL Splitbutton. You can find this control on the TABLE, MAP and SPATIAL tab.

    The SQL Spplitbutton is divided into three areas:

    1. The SQL Commands such as SQL Select, Update Columns and the new SQL Window.
    2. A list of favorites MapBasic scripts
    3. A list of recently used MapBasic scripts

    I'd better highlight that a MapBasic script now can be a SQL Select statement, a SQL Update statement, a SQL Insert statement, a SQL Delete statement and it can also be a mixture of all these and many other MapBasic statements. It's a way for you to automate for example data loading and processing into an easy task.

    1. The SQL Commands

    Amongst the SQL Commands, you will find some of the classic controls that have been around for decades but there are also some new features between these. We decided to add them all to a single splitbutton to give you quick access to everything related to SQL.

    The classics are the SQL Select, Simple Select, and Update Column. We have kept these as we know some users have gotten very used to these dialogs.

    The new commands are Select By Location, the SQL Window, and Close Queries. Select By Location has already been discussed in this article on the Community. The same goes for the new SQL Window.

    Close Queries lets you close all queries with a single click. It will close all temporary queries, named and unnamed. Named queries are those that you named using the Into keyword. Unnamed are typically named Queryx where x can be a number between 1 and 9999. It's a quick way to get rid of all your temporary tables once you have finished your analysis.

    2. Favorite MapBasic scripts

    In the area of your favorite scripts, you will find those scripts that you have stared to make sure they always will get loaded into the list for quick access. You can keep 100 favorites scripts in the Favorites area. And as you can see it has a scrollbar on the left side if you have more than around 10.

    The icons next to the names of the MapBasic scripts give you an idea of the type of script: Select, Insert, Update, Delete and a general MapBasic script.

    When you place your mouse on top of a favorite script, you will see a popup with the commands of the script, or at least a big part of the script. At the top of the popup, you can also see the file location of the MapBasic script file.

    On the right side of the script name, you can click on a button to open the script in the SQL Window or unstar the script to remove it from the Favorites list.

    If you click on the MapBasic script, MapInfo Pro will execute the commands in the script. This is an easy way to execute small scripts without having to open them first.

    3. Recent MapBasic scripts

    In the list of the recently used MapBasic scripts, you will find the scripts that you have used recently but that hasn't been saved as favorite scripts. This list is currently limited to 10 MapBasic scripts.

    Similar to the Favorites list, you will see a popup when you place your mouse over a MapBasic. You can also open the script in the SQL Window using the Edit Query button on the right side of the script and finally you can add the script to the Favorites list using the star.

    If you click on the MapBasic script, MapInfo Pro will execute the commands in the script.

    I hope you have found this small overview useful. If you have ideas or suggestions on how we can improve this even further, let us know via comments below or via the Ideas Portal.

    Also, if you want to share examples of how you are taking advantage of these new options, we would love to hear about that.

    Peter Horsbøll Møller
    Distinguished Engineer
    Pitney Bowes Software & Data