Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
OpenCities Map
  • Product Communities
  • Geospatial
  • OpenCities Map
  • Cancel
OpenCities Map
OpenCities Map Wiki - Key-ins to created queries incorporating a simple WHERE
    • Sign In
    • -OpenCities Map Wiki
      • -OpenCities Map
        • - End of Support for Bentley Map V8i (SELECTseries) products
        • +Release Information
        • +Installation Information
        • +Getting Started
        • +Administration
        • +General Topics
        • +Geospatial Administrator
        • +Feature Definitions and Inference Rules
        • +Interoperability
        • -Spatial Databases
          • - 3D arcs being stroked when posted and queried
          • - Angle of queried point feature is wrong
          • - Conflict Inspector
          • - Convert DGNs with MSLinks to MS SQL Server Spatial via FME
          • - Create domain lists in Microsoft SQL Server Spatial or Oracle
          • - Create XFM DGN file using Import from database
          • - Creating a Map schema for spatial features
          • - Creating Oracle Spatial multi-table views
          • - Creating Oracle Spatial Views
          • - Data streaming
          • - Data streaming and the Data Browser
          • - Date field settings for use with PBA in SQL Server
          • - Determine which features are locked and modified
          • - Difference between Erase and Delete for removing spatial database features
          • - Disable Connect to Database dialog
          • - Esri File Geodatabase as a Graphical Source
          • - Establish database connection upon startup
          • - Item names showing __x00##__
          • - Keep connection to database open when changing files
          • - Key-ins for interacting with spatial databases
          • - Key-ins to created queries incorporating a simple WHERE
          • - Long transactions - Versioned optimistic transactions
          • - Non planar polygon posting error ORA-54505
          • - Oracle views in spatial feature definitions
          • - Plane Constraint settings
          • - Register features times out with error
          • - Saving connection parameters to settings file
          • - SQL Server Features Not Displaying in Bentley Map
          • - Supported OGC geometry types
          • - Using joins to create custom searches
          • - WFS graphical source connection and feature registration
          • - Connecting to ArcGIS Server
        • +Spatial Analysis
        • +3D Geospatial
        • +Geographic Coordinate Systems
        • +Troubleshooting
        • +Freeware - Utilities - Applications - Programs
        • +Advanced Map Finishing
      • OpenCities Map Ultimate for Finland CONNECT Edition x64 (SES)
      • OpenCities Map Ultimate for Finland CONNECT Edition - Suomi
      • Bentley Descartes
      • +Other Geospatial Products

     
     Questions about this article, topic, or product? Click here. 

    - Key-ins to created queries incorporating a simple WHERE

    As an administrator for Bentley Map, you might prefer to create pre-defined connection parameters that can be used with the GDI CONNECT and GDI QUERY keyins. Doing so will enable you to place a library of keyins on a menu bar, custom tool box or function keys. This will streamline production workflows and eliminate errors from incorrectly defined search criteria.

    Since GDI keyins do not provide the ability to specify a WHERE clause, the following content describes a workaround that may be of interest if simple search criteria are needed.

    In this example, I have a named connection Nash where the property symbologies are defined in the Bentley Geospatial Administrator.

    The Parcels feature has a Where Clause defined as (HEATING_FUEL = Electric)

    This connection can be saved to an XML file by using Save As XML in the Connection Tools icon bar. While the content of the file is XML, the extension is ORAX.

    Once the ORAX files are created, you can use them with the GDI CONNECT keyin:

     GDI CONNECT FILE=FileName USER=UserName PASSWORD=Password.

     GDI CONNECT FILE=C:\Data\Nash\ParcelsElectric.orax PASSWORD=nash

    Note: The ORAX file stores the Oracle OpenParameters which includes the User, Host, Service and Port but not the Password.
    Optionally the password can be added to the ORAX file. In the XML file add an element for the password using a text editor or XML editor.

    Add password using text editor Add password using XML editor

     

    To query the just the parcels with the Where Clause, the following keyin can be executed:

    GDI QUERY FEATURE=Parcels VIEW 1

     

    To eliminate a datapoint to accept the processing, append the POINT AB keyin.

    GDI QUERY FEATURE=Parcels VIEW 1;POINT AB

    Note: Care should be taken to ensure that the Apply Where Clause is enabled:

    Alternate methods of setting up queries with search parameters might include:

    • Set up and query views in the database rather than using searches in Bentley Map.
    • Create a COM server that encapsulates some of the functionality available in the Bentley Map Interoperability API which is delivered as managed .NET assemblies. After encapsulating the Interoperability functionalities in a simple COM server, create a VBA application that uses the COM server to perform various Oracle Spatial Interoperability functions including the use of Where critera for searching and querying.
    • Lastly,  the use Live DGN might be helpful.  Live DGN contains the connection parameters to the features defined in the connection. When the DGN file is opened, a password will be requested and the connection made. At that point all of the requested features will be queried into the DGN. Note that his is for Oracle Spatial only.

    For more information regarding the GDI family of commands, please refer to:

    Spatial Database Keyins

    • Spatial
    • Querying
    • GDI
    • Share
    • History
    • More
    • Cancel
    • Inga Morozoff Created by Bentley Colleague Inga Morozoff
    • When: Wed, Jan 17 2018 1:29 PM
    • Kees van Prooijen [Bentley] Last revision by Bentley Colleague Kees van Prooijen [Bentley]
    • When: Wed, Dec 15 2021 6:01 AM
    • Revisions: 8
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies