CMDB_CI table database view

anvitha ash
Tera Contributor

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

anvithaash_0-1695190775257.png

 

can someone help me with it

3 REPLIES 3

CasperJT
Tera Guru

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

@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 

 

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.