Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Database Views with "left joins" fail to retrieve correct data - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Database Views with "left joins" fail to retrieve correct data
KB0745443

Database Views with "left joins" fail to retrieve correct data


5395 Views Last updated : May 28, 2024 public Copy Permalink
KB Summary by Now Assist

Description

When the left join coercion is active on the instance (System Property 'glide.db.coerce_left_joins' is either not existing on the instance or existing and set to 'true'), the query fails to retrieve correct data on database views with left join.

Steps to Reproduce

  1. Create a Database View with the left join as follows:
    1. Name = u_db_view
    2. Add a view table to the database view:
      • table= asmt_metric_result
      • Order= 100
      • Variable Prefix = metricres
      • Where clause = (keep it empty)
      • left join = false
    3. Add another view table to the database view:
      1. table=asmt_metric_definition
      2. Order= 200
      3. Variable Prefix = mdef
      4. Where clause = mdef_sys_id=metricres_metric_definition
      5. left join = true
  2. Go to the following URL and no records are fetched:
    https://<instance-name>.service-now.com/u_db_view_list.do?sysparm_query=metricres_metric.nameSTARTSWITHworking

Workaround

Beginning in the Vancouver release, a new left join optimizer is available to opt-into and aims to solve many of the issues observed with the previous optimizer.  This new strategy is now the default in the Washington release and beyond.  To enable this new strategy in Vancouver: 

  1. Verify that the System Property 'glide.db.coerce_left_joins' does not exist.  If it does exist in your instance, set it to 'true'.
  2. Set the System Property 'glide.db.coerce_left_joins.version' to 'V2'.  If it does not exist in the instance, you can create it to apply the workaround
    • Name: glide.db.coerce_left_joins.version
    • Type: String
    • Value: V2
  3. Open the link and note that now records are returned:
    https://<instance-name>.service-now.com/u_db_view_list.do?sysparm_query=metricres_metric.nameSTARTSWITHworking 

Prior to Vancouver, the recommended workaround is to disable the optimizer:

  1. Set the System Property 'glide.db.coerce_left_joins' to 'false'. If it does not exist in the instance, you can create it to apply the workaround:
    • Name: glide.db.coerce_left_joins
    • Type: True|False
    • Value: false
  2. Open the link and note that now records are returned:
    https://<instance-name>.service-now.com/u_db_view_list.do?sysparm_query=metricres_metric.nameSTARTSWITHworking 

Related Problem: PRB1326267

Potentially Seen In

There is no data to report.

Fixed In

Vancouver

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.