Database View Shows No Results When I Add Class to the Where Clause
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 08:13 AM
I created a view that was working but timing out. I am trying to edit the view so it doesn't have as much data so I want to ignore when child class is Manual Endpoint (for now but more to come) but when I add that clause, I get no results.
If I remove " && r2_child_sys_class_name != 'cmdb_ci_endpoint_manual'" the view "works" but it times out so I'm trying to remove some useless to us data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 08:43 AM
it's definitely due to huge data that it's timing out and the where clause is taking long time to join those tables
Try to add additional condition to minimize the records
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 09:06 AM - edited 05-29-2025 09:10 AM
Hello @Robert Campbell
In a database view, dot-walking is done using underscores (_) instead of dots (.).
So, for example:
ba1.operational_status != 'Retired'
should be replaced with:
ba1_operational_status != 'Retired'
Similarly, update the Where clause for all other tables accordingly.
For more details please refer to: Add a table to the database view
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 02:17 PM
Everything works except when I add that one where clause. As long as it's only 1 dot-walk, I can use the '.' rather than '_'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 10:49 PM
Hello @Robert Campbell
I tried replicating this in my PDI and interestingly found that r2_child refers to the cmdb_ci_service, which is represented by bs1 in this case. So, you can replace:
&& r2_child_sys_class_name != 'cmdb_ci_endpoint_manual'
with:
&& bs1_sys_class_name != 'cmdb_ci_endpoint_manual'
Make sure to apply this condition specifically for the cmdb_ci_service table.
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar