This appears whenever I attempt to modify modules:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sham_drupal.drupal_cache_views' doesn't exist: TRUNCATE {cache_views} ; Array ( ) in cache_clear_all() (line 170 of /home/sham/public_html/includes/cache.inc).

***

This error appears at the bottom of my Modules screen:

Warning: Cannot modify header information - headers already sent by (output started at /home/sham/public_html/includes/common.inc:2561) in drupal_send_headers() (line 1040 of /home/sham/public_html/includes/bootstrap.inc).
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sham_drupal.drupal_views_view' doesn't exist: SELECT t__0.* FROM {views_view} t__0; Array ( ) in ctools_export_load_object() (line 368 of /home/sham/public_html/sites/all/modules/ctools/includes/export.inc

Comments

dawehner’s picture

Status: Active » Fixed

So views_view table does not exist.

Please

a) redownload the views module
b) uninstall and reinstall the views module.

This should be fixed with this.
You probably

The Midnighter’s picture

I would attempt to do this, however "Views" is not available under "Uninstall" in modules. I have disabled the Views module, and everything associated with it - "Views" is still not available to uninstall.

When attempting to reinstall, it says "Views" is already installed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

avonleadesign’s picture

I also have this problem. Following...

khan2ims’s picture

Did you tried uninstalling and then reinstalling Views module? That should fix the problem.

If not, then you can try creating the table by using sql query

CREATE TABLE IF NOT EXISTS `cache_views` (
  `cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.',
  `data` longblob COMMENT 'A collection of data to cache.',
  `expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
  `created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry was created.',
  `serialized` smallint(6) NOT NULL DEFAULT '0' COMMENT 'A flag to indicate whether content is serialized (1) or not (0).',
  PRIMARY KEY (`cid`),
  KEY `expire` (`expire`)
) ;


CREATE TABLE IF NOT EXISTS `cache_views_data` (
  `cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.',
  `data` longblob COMMENT 'A collection of data to cache.',
  `expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
  `created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry was created.',
  `serialized` smallint(6) NOT NULL DEFAULT '1' COMMENT 'A flag to indicate whether content is serialized (1) or not (0).',
  PRIMARY KEY (`cid`),
  KEY `expire` (`expire`)
) ;
dstrider’s picture

Just had this problem with drupal 7, cache_views_data became corrupted. I had to drop the table 1st then use code above to create the table again. Appears to work now. Hoping this will not be happening often. :o)

dsmallwo’s picture

Issue summary: View changes

Dstrider can you provide more info on your fix? I'm a beginner here and I think I understand your fix but would appreciate more info on how to go about it. What exactly would I drop? I'd then recreate the table using the code above in the SQL section of my phpmyadmin correct? Thanks for the info.

dstrider’s picture

I use XAMPP. So I opened myPHPadmin, (admin in xampp control panel, or localhost in browser with mysql running.) select the database for the site in question, select SQL tab. You then have a place to type commands.
'DROP table xxxxxx' is the syntax I believe. EXACT TABLE WOULD BE THE ONE IN THE ERROR.`cache_views`
After the table is dropped successfully, you can use the SQL command area again to paste the code from above to recreate the file. I have not had this problem for weeks now.

sara_magdziak’s picture

Hi, I tried the above where I dropped the table and created one again and I am still getting this error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'test.cache_views_data' doesn't exist: TRUNCATE {cache_views_data} ; Array ( ) in cache_clear_all() (line 168 of C:\Users\Sara\Desktop\XAMPP\htdocs\drupal\includes\cache.inc).

Any other solutions?
Please HELP I have been trying to figure it out fr a day now :/