Database View

harry24
Tera Contributor

What is database view?Practical demo of how to create Database view and how to use it.

1 ACCEPTED SOLUTION

MD AQUIB KHAN
Giga Guru

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.

Note: In general, as the number of tables that are included in the view and the number of records that those tables contain increases, the accumulated impact on performance grows. In addition, to optimize the performance of the database view ensure that the ‘where’ clauses that are defined in the database view are based on indexed fields.
For Example:
Database view Name:Incident SLA
you can create database view and the two tables (incident, task_sla) in the related tabs (View Tables). Once you add them. You can use the same database view in the report as table.Once done you can run the report.
Please find the screenshot below:
find_real_file.png
Report:
Using the database view in Table:
find_real_file.png
 
 
 
 
 
 
 

View solution in original post

16 REPLIES 16

MrMuhammad
Giga Sage

The database fetches data from multiple tables for reporting purposes where reporting cannot be done on a single table.

For testing, you can follow the Servicenow docs example creation below at

https://docs.servicenow.com/bundle/orlando-platform-administration/page/use/reporting/task/t_CreateA...

Hope that helps!

Thanks & Regards,

Sharjeel

Regards,
Muhammad

MrMuhammad
Giga Sage

Also, look at this guide for practicle use cases.

http://docshare02.docshare.tips/files/23965/239654811.pdf

Regards,
Muhammad

Thanks  .. I found it helpful

Tried the following view

find_real_file.png

When tested it (as admin) I received the following message:

find_real_file.png

 

Sajilal
Mega Sage

Think of two tables like Incident and Metrics, once you create a Database view of both the tables joined together it gives you a view of all Incidents with appropriate Metrics, columns of both the Tables for your Reporting usage.

Hence the use of Database view.

There are lot of examples in the ServiceNow Documentations. check the ones shared by Muhammad.

Thanks,

Saji