CMDB_CI table database view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 11:21 PM
Hi,
I am trying to build database view between "cmdb_ci" table with "cmdb_ci_business_app", "cmdb_ci_desktop_software", "cmdb_rel_ci", "cmdb_ci_server"
I am stuck with what needs to be the where clause condition. I don't have exposure to CMDB tables and database view
can someone help me with it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 11:27 PM
Hi Anvitha,
Depending on, what you are trying to achieve you may want to check out the CMDB query builder instead of creating a database view.
Build a CMDB query using the CMDB Query Builder (servicenow.com)
The cmdb_rel_ci table acts an m2m between cmdb_ci tables. So your where clause should take in to consideration the parent and child fields being references to cmdb_ci.
Hope this helps.
//Casper
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 12:08 AM
@CasperJT thanks for your response,
Initially we tried to build query builder but it doesn't fulfill our requirement.
We have 3 custom fields in the "cmdb_ci_business_app" , "cmdb_ci_desktop_software" and network gear table. we want to create common view between cmdb_ci table with these tables for reporting
As i am new to CMDB not sure how these tables can be mapped. Not sure what should be the where clause
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 04:51 AM
If you want to create a db view between cmdb_ci and cmdb_rel_ci then you will need to use a where clause similar to
rel_parent=bus_app_sys_id
rel being the view table cmdb_rel_ci and bus_app being cmdb_ci_business_app.
You will need to do the same for the child field on the cmdb_rel_ci table.
Hope this makes sense.