Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise Design Integration Wiki How to combine two select queries
    • Sign In
    • ProjectWise Design Integration Wiki
    • ProjectWise Software Download
    • +ProjectWise Learning
    • +Projectwise Licensing
    • ProjectWise Programming and PowerShell
    • +Projectwise Documentation
    • -ProjectWise Explorer Client
      • +ProjectWise Client
      • +Featured Articles - Projectwise Explorer
      • +Audit Trail - ProjectWise Explorer Client
      • +Bentley IMS Login
      • +BS1192 Rules Engine - ProjectWise Explorer Client
      • +Check In Dialog - ProjectWise Explorer Client
      • -Document Code - ProjectWise Explorer Client
        • How to combine two select queries
        • Incorrect / wrong serial number is generated in document code
        • Last Error 58129: Can not create the document. Document Code serial number is invalid.
        • User is trying to format a number for hi... (Solution 500000101441)
        • Sequence number / serial number is not increasing in document code
        • Sequence number is not increasing in document code / document code case sensitive
      • +Document Creation - ProjectWise Explorer Client
      • +Documentation & Help - ProjectWise Explorer Client
      • +Environments and Attributes - PWE
      • +Export / Import Tool - ProjectWise Explorer Client
      • +Folders / Subfolders - ProjectWise Explorer Client
      • +GUI - ProjectWise Explorer Client
      • +Installation - ProjectWise Explorer Client
      • +Integration - General
      • +Integration - AutoCAD - ProjectWise Explorer Client
      • +Integration - Civil 3D - ProjectWise Explorer Client
      • +Integration - DGN Platform - ProjectWise Explorer Client
      • +Integration - MicroStation - ProjectWise Explorer Client
      • +Integration - Office - ProjectWise Explorer Client
      • +Integration - Revit - ProjectWise Explorer Client
      • +Logs Troubleshooting- ProjectWise Explorer Client
      • +Messaging Service - ProjectWise Explorer Client
      • +MISC - ProjectWise Explorer Client
      • +Open / Save / Copy / Move - ProjectWise Explorer Client
      • +Photo Preview - ProjectWise Explorer Client
      • +ProjectWise Managed Workspaces
      • +Project - ProjectWise Explorer Client
      • +Search - ProjectWise Explorer Client
      • +Security and Permissions - ProjectWise Explorer Client
      • +User Tools - ProjectWise Explorer Client
      • +Views - ProjectWise Explorer Client
      • +Workflows & States - ProjectWise Explorer Client
    • +ProjectWise Administrator
    • +ProjectWise Integration Server
    • +ProjectWise Caching Server
    • +ProjectWise Gateway Server
    • +ProjectWise User Synchronization Service
    • +ProjectWise Orchestration Framework
    • +ProjectWise Connected Services
    • +Working from Home with ProjectWise
    • +ProjectWise Glossary
    • ProjectWise Hosting - Manage Services

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

    How to combine two select queries

      Product(s): ProjectWise Explorer Client
      Version(s): 08.11.11.559
      Environment:  Windows 7 64 bit
      Area:  Document Code
      Original Author: Arturas Baranauskas, Bentley Technical Support Group

    Sometimes users might need to add a additional query to an already existing one that is being used to populate a value select list in the ProjectWise.

    In this scenario we have a already existing query that returns a list by filtering it trough filter attribute and a form value(filter and some_attribute) it returns us a list, but we need to have a fixed amount of values added to a list that can be accessed by using another filter value.

    So if original query(Select name, description from env_table_name where filter = ‘filter name’ AND some_attribute = '$EDIT#Attribute1$’ ORDER BY sort_attribute) would return:

    Value 1

    Value 2

    Value 3

    And additional
    query(Select name, description from env_table_name where filter = ‘some value’ ORDER BY sort_attribute)would return:

    Test1

    Test2

    Test3

     

    The end result we are going for is:

     

    Value1

    Value2

    Value3

    Test1

    Test2

    Test3

    How to combine two select queries to return a single list in ProjectWise attribute form:

    We could use UNION operator but this is a rather highly depending on format and might not work at all so the best way to go around in this case is to use OR operator:

    SELECT name, description from env_table_name where filter = ‘filter name’ AND( some_attribute = ‘$EDIT#Attribute1$’ OR filter = ‘some value’) ORDER BY sort_attribute

    • Windows 7 64 bit
    • 08.11.11.559
    • Generic
    • ProjectWise Explorer Client
    • Document Code
    • SELECTsupport
    • Share
    • History
    • More
    • Cancel
    • Arturas Baranauskas Created by Arturas Baranauskas
    • When: Fri, Aug 16 2013 2:22 AM
    • Dana Guthrie Last revision by Bentley Colleague Dana Guthrie
    • When: Mon, Sep 26 2022 2:00 PM
    • Revisions: 5
    • 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