- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2020 03:19 AM
What is database view?Practical demo of how to create Database view and how to use it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2020 04:09 AM
Hi Harry,
A database view defines table joins for reporting purposes.
For example, a database view can join the Incident table to the Metric Definition and Metric Instance tables. This view can be used to report on incident metrics and may include fields from any of these three tables.
A number of useful database views are installed with the Database View plugin and the Database Views for Service Management plugin. These database views cover most metric reporting needs and greatly reduce the need to define new ones.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2020 03:32 AM
but this can be done using dot walking on related list? so why need of database view?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2020 03:42 AM
Let me give you a very recent use case.
Let say you need a report to list all the Computers and VMware that are NOT associated with any incident record. Now in this case three tables are involved that require comparison.
incident table
task_ci table [M2M table that holds the association between task and Ci].
cmdb_ci or computer and vmware table.
In this scenario, you cannot dot walk between all the tables. so you need to create database views and using queries you will display the limited required data. In our example case the Information of CI's that are not associated with any incident.
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2020 03:48 AM
Yes you are right, but think of Database views as more complex needs of aggregation between tables, like left join or outer join between two etc.
Even between three tables like Incident, Metrics, SLA and this you cannot achieve by related list.
Check this old wiki Documentation for more info
https://old.wiki/index.php/Database_Views
Thanks,
Saji

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2020 03:30 AM
Hi Harry,
Database view is a combination of multiple tables so as to generate a view (virtual table) that an be used for reporting.
Consider an example of RITM & Incident table where you want to check or display all records that have been opened for same user. This though can be directly reported on Task table but you will to look for Requested for field (from RITM) & Opened by (field from Incident).
Since, Requested for does not exists on task table report cannot be directly generated on task table & thus clalls in a need to create a database view which can be used for reporting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2020 03:32 AM
but this can be done using dot walking on related list? so why need of database view?