How to link tables in database view using reference field display value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2022 12:59 PM
i am trying to create a database view using reference field display value as condition (where clause).
Example:
I need to create a database view on Hardware table (cmdb_ci_hardware) and installed software (cmdb_sam_sam_sw_install) table
where cmdb_ci_hardware.name = cmdb_sam_sam_sw_install.installed_on (installed_on is reference field on the hardware table)
Here is what I am trying in the database view:
cmdb_ci_hardware (prefix=hd), order 100, where clause Empty
cmdb_sam_sam_sw_install (prefix=sam), order 200, where clause = hd_name = sam_installed_on
I also tried under the where clause: hd_name = sam_cmdb_sam_sam_sw_install.installed_on
it returns zero records. I have already confirmed that there are software installed servers
Any guidance OR directions greatly appreciated.
thanks
Alex
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 04:40 AM
Hi Alex,
If one table has a reference field, it is possible to use what we call Dot Walking to retrieve records joining these tables.
Please refer to this THREAD for examples.
________________________
Carlos Camacho
https://www.linkedin.com/in/camachojunior

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2022 06:16 AM