MapInfo Pro

 View Only
  • 1.  "seach all"

    Posted 06-27-2022 11:32
    Has anbody experience with a :"search all" query that searches a browser independently of column names, type of data etc and returns the search results in a browser

    ------------------------------
    Ad van Ooststroom
    Bergen op Zoom, NL
    ------------------------------


  • 2.  RE: "seach all"

    Employee
    Posted 06-28-2022 02:57
      |   view attached
    Hi Ad

    Can you give this tool a try?
    When you run it, it adds a button to the Table tab in the Sort and Filter group.

    It works on the table in the active browser window and will search through most columns for the given value.

    This is the structure that controls which columns to search:
    Do Case ColumnInfo(sTab, sCol, COL_INFO_TYPE)
      Case COL_TYPE_CHAR
        sCond = sCol & " Like " & Chr$(34) & msInput & Chr$(34)
      Case COL_TYPE_INTEGER, COL_TYPE_SMALLINT, COL_TYPE_LARGEINT
        sCond = "Str$(" & sCol & ") Like " & Chr$(34) & msInput & Chr$(34)
      Case COL_TYPE_DECIMAL, COL_TYPE_FLOAT
        sCond = "Str$(" & sCol & ") Like " & Chr$(34) & msInput & Chr$(34)
      Case COL_TYPE_DATE, COL_TYPE_DATETIME, COL_TYPE_TIME
        sCond = "Str$(" & sCol & ") Like " & Chr$(34) & msInput & Chr$(34)
    End Case

    As you can see numeric and date/time columns are cast to string before searching.
    I'm using the Like operator and I ensure the value you search does include at least one "%".
    If no "%" has been entered, I'll add one at each end of the string.

    For now, the command used to search is written to the Message window. We can consider turning this off once you are happy with the result.

    The attached file contains the source code and compiled MBX.

    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------

    Attachment(s)

    zip
    SearchAllMENU.zip   2 KB 1 version


  • 3.  RE: "seach all"

    Employee
    Posted 06-29-2022 03:03
      |   view attached
    Hi Ad,

    Here's a new version where I have removed the commend from the Message window.
    I'll get the tool cleaned up a bit more and added to the MapInfo Marketplace later.

    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------

    Attachment(s)

    zip
    SearchAllMENU.zip   2 KB 1 version


  • 4.  RE: "seach all"

    Employee
    Posted 9 days ago
    Hi Ad

    I made a tool from your request and some additional features.
    Check out this: https://community.precisely.com/discussion/multi-search-tool

    Peter

    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 5.  RE: "seach all"

    Posted 8 days ago
    Thanks Peter, I am using the previous "searchall" version all the time and will check out the new versions.

    ------------------------------
    Ad van Ooststroom
    Bergen op Zoom, NL
    ------------------------------