Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8567131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:48:46+00:00 2026-06-11T17:48:46+00:00

I have a table whose primary key is claims_id , but for legacy reasons

  • 0

I have a table whose primary key is claims_id, but for legacy reasons I need to be able to look up records with either of the parameters claims_id or claim_id. How can I achieve this? I’ve used a pattern like the following for search queries before:

select...
 where (
         {$claims_id} is null
         or
         claims.claims_id = {$claims_id}
       )
       and
       (
         {$claim_id} is null
         or
         claims.claims_id = {$claim_id}
       )

…but this just doesn’t seem quite right to me, as you could provide both parameters to the query, which doesn’t make any sense. What’s the correct way to achieve something like this?

These are large tables, and so if for someone reason neither parameter is specified, the query should return nothing.

Update: Noting that the database in question is DB2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:48:47+00:00Added an answer on June 11, 2026 at 5:48 pm

    If it isn’t possible to adjust the broker so that it only allows for the one parameter name, then my recommendation is to have a pre-workflow for the operation which checks for the existence of the two parameters and adjusts them as necessary.

    For the most simple example,

    <workflow>
      <if test="not-equal" value1="{$parameters.claims_id}" value2="">
        <then>
          <set-field field="parameters.claim_id" value="{$parameters.claims_id}"/>
        </then>
      </if>
    </workflow>
    

    Then in the query you would only concern yourself with the claim_id parameter.

    This would also allow situations where both parameters are provided to be dealt with or recorded in some manner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table (A) whose primary key is either a foreign key to
I have a table whose primary key is a column named St_ID . I
I have a Data table whose primary key should be case sensitive. i.e. 'abc'
Right now, I have a table whose primary key is an auto_increment field. However,
I have a MySQL table of users whose primary key is an auto-incrementing integer
I have a table called 'Docs' whose primary key is a combination of following
I have a table DEVICEDETAILS whose primary key is DEVICEID. I would like to
We have a table, with an auto-increment int primary key, whose max value is
I have a MySql table whose primary key is a 64bit BigInt I'm using
I have a table whose primary key is used in several other tables and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.