Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
ProjectWise
  • Product Communities
  • More
ProjectWise
ProjectWise Design Integration Wiki How to combine two select queries
    • Sign in
    • +ProjectWise Design Integration Wiki
    • +Bentley i-model Composition Server
    • +Field Data Management - Welcome
    • +ProjectWise Caching Server
    • +ProjectWise Change Storage Area
    • +ProjectWise Integration CONNECT Edition
    • +ProjectWise Design Integration Server
    • +ProjectWise Design Integration V8i
    • +ProjectWise Document Publisher
    • -ProjectWise Explorer Client
      • 55037 Error moving document User cannot delete corrupt files
      • A way to list users and working dirs
      • A way to search documents in a specific version and showing related references (references and referenced by) on search results
      • A way to search only document versions in PW
      • Application Error The instruction at 0x5ad71531 referenced memory at 0x00000014
      • Attribute Exchange tabs grayed out in Excel 2007
      • Attribute not showing in modify command dialog box
      • +Audit Trail - ProjectWise Explorer Client
      • Batch File Renaming in ProjectWise
      • +Bentley IMS Login
      • +BS1192 Rules Engine - ProjectWise Explorer Client
      • Cannot open file class not registered
      • +Check In Dialog - ProjectWise Explorer Client
      • Copy files with document codes
      • Datasources not displaying in ProjectWise Explorer
      • -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)
      • +Document Creation - ProjectWise Explorer Client
      • +Documentation & Help - ProjectWise Explorer Client
      • Drag and Drop Issue in ProjectWise Explorer
      • Error -11149 Cannot save instance to storage
      • Error 112219 "Invalid filename"
      • Error 2627
      • Error 50176 Cannot start application for the specified document. Check your program associations. Operating system function call failed.
      • Error 58057 Creating new version of document in folder
      • Error found in Custom UI XML of "ProjectWise iDesktop Integration"
      • Error on thread and file stuck with coming in status
      • +Export / Import Tool - ProjectWise Explorer Client
      • Failed to get object identifier by its GUID
      • Folder descriptions displaying instead of name?
      • +Folders / Subfolders - ProjectWise Explorer Client
      • +GUI - ProjectWise Explorer Client
      • Inherited Environment
      • +Installation - ProjectWise Explorer Client
      • +Integration - AutoCAD - ProjectWise Explorer Client
      • +Integration - DGN Platform - ProjectWise Explorer Client
      • +Integration - MicroStation - ProjectWise Explorer Client
      • +Integration - Office - ProjectWise Explorer Client
      • +Integration - Revit - ProjectWise Explorer Client
      • Integration with FME
      • Invalid socket The connection to the remote host is broken
      • Issue with Bentley Connect Edition and AutoCAD 2014 Civil 3D and Civil 3D 2016 on same PC
      • Last Error 347 Cannot start application for the specified document
      • Last Error 58174. Error moving document
      • +Logs Troubleshooting- ProjectWise Explorer Client
      • Make external clients unable to use licensing
      • +Messaging Service - ProjectWise Explorer Client
      • Microsoft Office 2010 prerequisites are missing
      • +MISC - ProjectWise Explorer Client
      • No scroll bar on the Attribute properties tab
      • +Open / Save / Copy / Move - ProjectWise Explorer Client
      • Opening a file integrated with PW uses the local workspace
      • Optimizing File Transfer Performance in ProjectWise Explorer
      • PDF for Photo Preview are not showing
      • +Photo Preview - ProjectWise Explorer Client
      • Photo-Preview Fix
      • +Project - ProjectWise Explorer Client
      • ProjectWise Explorer Won't Start or is Giving you a "PWC.exe -Application Error
      • Revit - “The file is already open for editing in another process"
      • +Search - ProjectWise Explorer Client
      • +Security and Permissions - ProjectWise Explorer Client
      • Sequence number / serial number is not increasing in document code
      • Setting the default startup folder
      • Spatial Tab missing in ProjectWise Explorer CONNECT for other accounts than main administrator (pwadmin)
      • Troubleshooting ProjectWise Explorer using Process Monitor (ProcMon)
      • +User Tools - ProjectWise Explorer Client
      • Using ScanRefs.exe
      • Using the Local Document Organizer In ProjectWise
      • +Views - ProjectWise Explorer Client
      • Workflow rules engine, Error -50001 Attribute specified in action not found
      • +Workflows & States - ProjectWise Explorer Client
    • +ProjectWise Explorer Client V8i
    • ProjectWise Explorer Connect Edition Upd3 Unattended Install
    • +ProjectWise integration module for Revit
    • +ProjectWise Integration Server
    • +ProjectWise Publishing Server
    • +ProjectWise Solutions
    • +ProjectWise Web View Server
    • ProjectWise Project Insights
    • +ProjectWise Web Cloud Service
    • +ProjectWise Drive
    • +ProjectWise Web View
    • +Microsoft Teams Integration
    • +ProjectWise Workflow Rules Engine
    • +Working from Home with ProjectWise
    • ISO 19650 data model within ProjectWise
    • Learn ProjectWise

     
     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
    • Thomas Hess Last revision by Thomas Hess
    • When: Tue, Aug 2 2016 10:51 AM
    • Revisions: 4
    • 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

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