<h2>Creating database views for reporting</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2025" /><meta name="DC.rights.owner" content="(C) Copyright 2025" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="concept" /><meta name="DC.title" content="Creating database views for reporting" /><meta name="abstract" content="A database view defines table joins for reporting purposes." /><meta name="description" content="A database view defines table joins for reporting purposes." /><meta name="DC.subject" content="Advanced Reporting, database views" /><meta name="keywords" content="Advanced Reporting, database views" /><meta name="DC.relation" scheme="URI" content="../../../build/custom-application/concept/planning-applications.html" /><meta name="DC.relation" scheme="URI" content="../../../build/custom-application/concept/build-applications.html" /><meta name="DC.relation" scheme="URI" content="../../../use/reporting/task/c_CreatingDatabaseViews.html" /><meta name="DC.relation" scheme="URI" content="../../../use/reporting/task/displaying-function-results-in-a-database-view.html" /><meta name="DC.relation" scheme="URI" content="../../../use/reporting/concept/c_UseDisjunctionsInComplexQueries.html" /><meta name="DC.relation" scheme="URI" content="../../../use/reporting/reference/r_DatabaseViewsInTheBaseSystem.html" /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-08-03" /><meta name="DC.date.modified" content="2023-08-03" /><meta name="mini-toc" content="yes" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="c_DatabaseViews" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>Creating database views for reporting</title></head><body id="c_DatabaseViews"> <div class="breadcrumb"><a class="link" href="../../../build/custom-application/concept/build-applications.html" title="Learn how to become an application developer using Now Platform low-code tools. Start with what you know and use a library of reusable components and published applications to modernize your legacy processes.">Building applications</a> > </div> <h1 class="title topictitle1" id="ariaid-title1">Creating database views for reporting</h1> <div class="body conbody"><p class="shortdesc">A database view defines table joins for reporting purposes.</p> <p class="p">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.</p> <p class="p">Several 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.</p> <p class="p">Any user who can create a report can use database views as the report source, but ACLs on the underlying tables are honored.</p> <div class="note"><span class="notetitle">Note:</span> <ul class="ul" id="c_DatabaseViews__ul_nd5_qwm_cqb"><li class="li">The accumulated impact on performance grows as the number of tables that are included in the view and the number of records that those tables contain increases. To maximize the performance of the database view, ensure that the ‘where’ clauses that are defined in the database view are based on indexed fields.</li><li class="li">A database view is not treated like a custom table, so there is no licensing impact.</li><li class="li">Database view tables are not included in FTP exports.</li></ul> </div> <div class="section"><h2 class="title sectiontitle">Limitations</h2> <ul class="ul"><li class="li">Database views cannot be created on tables that participate in table rotation.</li><li class="li">It is not possible to edit data in the database view output.</li><li class="li">Database view tables cannot be added as a data preserver in clone requests.</li></ul> </div> <div class="section"><h2 class="title sectiontitle">ACLs and database views</h2> <p class="p">You do not need to create ACLs on fields in the view. The system honors contextual ACLs (ACLs with a condition or script) that exist on the underlying table. Non-contextual ACLs (ACLs with only role checks) are still honored just as with previous releases.</p> <p class="p"> To require explicit read ACLs be added to the database views, set the <span class="keyword parmname">glide.security.expander.view.legacy</span> property to <span class="ph uicontrol">true</span>. On upgraded instances, add this system property and set it to <span class="ph uicontrol">true</span>.</p> <p class="p">You can still create additional ACLs on the database views. These ACLs are evaluated last and are always honored.</p> </div> <div class="section" id="c_DatabaseViews__section_h5v_43w_x1b"><h2 class="title sectiontitle">Database view reserved words</h2> <p class="p">Using the terms may cause unintended or undesirable performance. For more information, see the <a class="xref" href="https://dev.mysql.com/doc/refman/5.5/en/keywords.html" target="_blank" rel="noopener noreferrer">MySQL reserved words document</a>.</p> </div> </div> <div class="related-links"> <ul class="ullinks"><li class="link ulchildlink"><strong><a href="../../../use/reporting/task/c_CreatingDatabaseViews.html">Database view creation</a></strong><br /> Create a database view to join tables. You can then create a report based on the database view.</li><li class="link ulchildlink"><strong><a href="../../../use/reporting/task/displaying-function-results-in-a-database-view.html">Displaying function results in a database view</a></strong><br /> Enhance the display of a database view by adding a function field to the output to display function results.</li><li class="link ulchildlink"><strong><a href="../../../use/reporting/concept/c_UseDisjunctionsInComplexQueries.html">Use disjunctions in complex queries</a></strong><br /> <span class="ph">ServiceNow</span> performs conjunction statements before disjunction statements in a query.</li><li class="link ulchildlink"><strong><a href="../../../use/reporting/reference/r_DatabaseViewsInTheBaseSystem.html">Database views in the base system</a></strong><br /> Certain views are included in the base system with the Database Views and Database Views for Service Management plugins.</li></ul> <div class="familylinks"> <div class="parentlink"><strong>Parent Topic:</strong> <a class="link" href="../../../build/custom-application/concept/planning-applications.html" title="The application development process starts with planning. Consider how the application will work, who will use it, and how it improves user experience.">Planning your application</a></div> </div> </div></body></html></div>