Answers.Body: <p>The stackbot bumped this so I figured I'd post an answer.</p>
  <p>If you are on less than 5.37, as per the comments you can disable then re-enable CiviCase and it will recreate the views.</p>
  <p>If you are on 5.37 or higher, the views no longer exist and this won't come up. See <a href="https://github.com/civicrm/civicrm-core/pull/19642" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/19642</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-14T23:40:19.797Z
Answers.LastActivityDate: 2021-10-14T23:40:19.797Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>Actually I can see one file name there that I do not think is part of core CiviCRM? This is the table <code>brpcvshome_cvs.civicrm_view_case_activity_upcoming</code>. </p>
  
  <p>That is potentially a table that is part of an extension or some local customization. Is your CiviCRM database actually called brpcvshome_cvs? If not, it might well be that you missed restoring a separate database? And if it is, can you check if that table is actually there?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-16T17:50:00.463Z
Answers.Text: Hi ErikH it is part of civicase - it's a view that gets created when you enable civicase, hence Pradeep's suggestion.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-18T13:06:05.607Z
Answers.Text: Ah it is a view, forgot to check that, only looked at the tables :-( My bad!
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-16T15:35:38.080Z
Answers.LastActivityDate: 2019-05-16T15:35:38.080Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>Any help please?
  Issue with Case dashboard and case tab on contact summary. No of this makes any sense to me???? civi 5.13.4</p>
  
  <p>I have deleted all files and SQL database and restored from previous backups - same issues</p>
  
  <p>civibackTrace</p>
  
  <pre><code>#0 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Error.php(192): CRM_Core_Error::backtrace()
  #1 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
  #2 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB.php(985): PEAR_Error-&gt;_constuct("DB Error: no such table", -18, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #3 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php(575): DB_Error-&gt;__construct(-18, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #4 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php(223): PEAR-&gt;_raiseError(Object(DB_mysqli), NULL, -18, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...", "DB_Error", TRUE)
  #5 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php(1907): PEAR-&gt;__call("raiseError", (Array:7))
  #6 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysqli.php(933): DB_common-&gt;raiseError(-18, NULL, NULL, " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...", "1146 ** Table 'brpcvshome_cvs.civicrm_view_case_activity_upcoming' doesn't exist")
  #7 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli-&gt;mysqliRaiseError()
  #8 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli-&gt;simpleQuery(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #9 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common-&gt;query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #10 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php(1607): DB_DataObject-&gt;_query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #11 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php(439): DB_DataObject-&gt;query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #12 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php(1491): CRM_Core_DAO-&gt;query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...", TRUE)
  #13 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Case/BAO/Case.php(639): CRM_Core_DAO::singleValueQuery(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #14 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Case/Page/DashBoard.php(87): CRM_Case_BAO_Case::getCases(NULL, (Array:0), "dashboard", TRUE)
  #15 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Case/Page/DashBoard.php(116): CRM_Case_Page_DashBoard-&gt;preProcess()
  #16 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(311): CRM_Case_Page_DashBoard-&gt;run((Array:2), NULL)
  #17 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(85): CRM_Core_Invoke::runItem((Array:15))
  #18 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:2))
  #19 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm.php(121): CRM_Core_Invoke::invoke((Array:2))
  #20 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm.php(40): civicrm_invoke()
  #21 /home/brpcvshome/domains/thecvs.org.uk/public_html/libraries/src/Component/ComponentHelper.php(402): require_once("/home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/c...")
  #22 /home/brpcvshome/domains/thecvs.org.uk/public_html/libraries/src/Component/ComponentHelper.php(377): Joomla\CMS\Component\ComponentHelper::executeComponent("/home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/c...")
  #23 /home/brpcvshome/domains/thecvs.org.uk/public_html/libraries/src/Application/AdministratorApplication.php(101): Joomla\CMS\Component\ComponentHelper::renderComponent("com_civicrm")
  #24 /home/brpcvshome/domains/thecvs.org.uk/public_html/libraries/src/Application/AdministratorApplication.php(159): Joomla\CMS\Application\AdministratorApplication-&gt;dispatch() 
  #25 /home/brpcvshome/domains/thecvs.org.uk/public_html/libraries/src/Application/CMSApplication.php(196): Joomla\CMS\Application\AdministratorApplication-&gt;doExecute()
  #26 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/index.php(51): Joomla\CMS\Application\CMSApplication-&gt;execute()
  #27 {main}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-16T11:59:15.953Z
Comments.Text: Try disabling and enabling CiviCase component.
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-16T15:18:52.527Z
Comments.Text: Also make sure the mysql database user has the create views privilege.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-28T18:33:17.320Z
Comments.Text: Thanks everyone...very much appreciated! Disable and enable works as you suggested...
Comments.UserDisplayName: Peter D
Tags: <civicase>
Title: Civi Case DB Error: no such table
ThreadText: # Civi Case DB Error: no such table
  
  (Asked by: username_0 on 2019-05-16)
  
  Any help please?
  Issue with Case dashboard and case tab on contact summary. No of this makes any sense to me???? civi 5.13.4
  I have deleted all files and SQL database and restored from previous backups - same issues
  civibackTrace
  #0 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Error.php(192): CRM_Core_Error::backtrace()
  #1 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
  #2 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB.php(985): PEAR_Error->_constuct("DB Error: no such table", -18, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #3 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-18, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #4 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -18, 16, (Array:2), " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...", "DB_Error", TRUE)
  #5 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
  #6 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-18, NULL, NULL, " SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...", "1146 ** Table 'brpcvshome_cvs.civicrm_view_case_activity_upcoming' doesn't exist")
  #7 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
  #8 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #9 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common->query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #10 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #11 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php(439): DB_DataObject->query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #12 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php(1491): CRM_Core_DAO->query(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...", TRUE)
  #13 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Case/BAO/Case.php(639): CRM_Core_DAO::singleValueQuery(" SELECT COUNT(*) FROM (SELECT civicrm_case.id as case_id, civicrm_case.subjec...")
  #14 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Case/Page/DashBoard.php(87): CRM_Case_BAO_Case::getCases(NULL, (Array:0), "dashboard", TRUE)
  #15 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Case/Page/DashBoard.php(116): CRM_Case_Page_DashBoard->preProcess()
  #16 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(311): CRM_Case_Page_DashBoard->run((Array:2), NULL)
  #17 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(85): CRM_Core_Invoke::runItem((Array:15))
  #18 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:2))
  #19 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm.php(121): CRM_Core_Invoke::invoke((Array:2))
  #20 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/com_civicrm/civicrm.php(40): civicrm_invoke()
  #21 /home/brpcvshome/domains/thecvs.org.uk/public_html/libraries/src/Component/ComponentHelper.php(402): require_once("/home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/c...")
  #22 /home/brpcvshome/domains/thecvs.org.uk/public_html/libraries/src/Component/ComponentHelper.php(377): Joomla\CMS\Component\ComponentHelper::executeComponent("/home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/components/c...")
  #23 /home/brpcvshome/domains/thecvs.org.uk/public_html/libraries/src/Application/AdministratorApplication.php(101): Joomla\CMS\Component\ComponentHelper::renderComponent("com_civicrm")
  #24 /home/brpcvshome/domains/thecvs.org.uk/public_html/libraries/src/Application/AdministratorApplication.php(159): Joomla\CMS\Application\AdministratorApplication->dispatch() 
  #25 /home/brpcvshome/domains/thecvs.org.uk/public_html/libraries/src/Application/CMSApplication.php(196): Joomla\CMS\Application\AdministratorApplication->doExecute()
  #26 /home/brpcvshome/domains/thecvs.org.uk/public_html/administrator/index.php(51): Joomla\CMS\Application\CMSApplication->execute()
  #27 {main}
  
  **Tags:** civicase
  
  > **Comments:**
  > **username_1**: Try disabling and enabling CiviCase component.  
  > **username_2**: Also make sure the mysql database user has the create views privilege.  
  > **username_3**: Thanks everyone...very much appreciated! Disable and enable works as you suggested...  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2021-10-14. Score: 1
  
  The stackbot bumped this so I figured I'd post an answer.
  
  If you are on less than 5.37, as per the comments you can disable then re-enable CiviCase and it will recreate the views.
  
  If you are on 5.37 or higher, the views no longer exist and this won't come up. See <https://github.com/civicrm/civicrm-core/pull/19642>.
  
  
  ---
  
  ### Answer by username_4 on 2019-05-16. Score: 0
  
  Actually I can see one file name there that I do not think is part of core CiviCRM? This is the table `brpcvshome_cvs.civicrm_view_case_activity_upcoming`.
  
  That is potentially a table that is part of an extension or some local customization. Is your CiviCRM database actually called brpcvshome\_cvs? If not, it might well be that you missed restoring a separate database? And if it is, can you check if that table is actually there?
  
  > **Comments:**
  > **username_2**: Hi ErikH it is part of civicase - it's a view that gets created when you enable civicase, hence Pradeep's suggestion.  
  > **username_4**: Ah it is a view, forgot to check that, only looked at the tables :-( My bad!  
  
  ---
  
  