Error 1347 Hy000 Is Not View
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site
Mysql Error 1347 Is Not View
About Us Learn more about Stack Overflow the company Business Learn more mysql error 1347 (hy000): ' ' is not base table about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Is Not Base Table Mysql
Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up MySQL : Storing error code 1347 is not base table business logic in table up vote 0 down vote favorite I have a table named test : create table demo (name varchar(10), mark1 int, mark2 int); I need the total of mark1 and mark2 for each row many times. select name, (mark1 + mark2) as total from demo; Which I am told is not efficient. I am not allowed to add a new total column error code 1347 is not view in the table. Can I store such business logic in Index? I created a view CREATE VIEW view_total AS SELECT name, (mark1 + mark2) as 'total' from demo; I populated the demo table with: DELIMITER $$ CREATE PROCEDURE InsertRand(IN NumRows INT) BEGIN DECLARE i INT; SET i = 1; START TRANSACTION; WHILE i <= NumRows DO INSERT INTO demo VALUES (i,i+1,i+2); SET i = i + 1; END WHILE; COMMIT; END$$ DELIMITER ; CALL InsertRand(100000); The execution time of select * from view_total; and select * from demo; is same, 10 ms. So I have not gained any benefit of view. I tried to create index over the view with : create index demo_total_view on view_total (name, total); which failed with error : ERROR 1347 (HY000): 'test.view_total' is not BASE TABLE Any pointer about how do I prevent the redundant action of totaling the columns? mysql sql database oracle share|improve this question asked Feb 18 '13 at 13:02 user1263746 79231022 1 why store this calculation as a hard value in the table? Why not just calc the sum as needed? Besides, management will change their mind soon enough (and you b
Fahl Email Updates: Status: Can't repeat Impact on me: None Category:MySQL Server: Optimizer Severity:S1 (Critical) Version:5.0.18 to 5.0.22 OS:Microsoft Windows (Windows XP) Assigned to: Georgi Kodinov View Add Comment
View Is Not Base Table
Files Developer Edit Submission View Progress Log Contributions [12 Jan 2006 9:17] Wolfgang Fahl mysql alter view Description: A simple table/view combination: CREATE TABLE testtable (oid varchar(32)); CREATE VIEW testview as select * from testtable; can not
Show Views Mysql
be restored with a mysqldump/mysql source combination if the following options are used for mysqldump: mysqldump --quick --add-locks --no-create-db --lock-tables --no-create-info --complete-insert --extended-insert=false The message ERROR 1347 (HY000): 'testbug.testview' is not BASE TABLE http://stackoverflow.com/questions/14937024/mysql-storing-business-logic-in-table will appear using --no-create-db and --no-create-info seem to lead to this behaviour How to repeat: drop database testbug; create database testbug; use testbug; CREATE TABLE testtable (oid varchar(32)); CREATE VIEW testview as select * from testtable; drop database testbug; #mysqldump --quick --add-locks --lock-tables --complete-insert --extended -insert=false --host=localhost --user=root --password testbug > mysqlbug9.sql # and restoring with drop database testbug; create database testbug; use testbug; source mysqlbug9.sql https://bugs.mysql.com/bug.php?id=16440 # works fine but mysqldump --quick --add-locks --no-create-db --lock-tables --no-create-info --complete-insert --extended-insert=false --host=localhost --user=root --password testbug > mysqlbug10.sql # and restoring with drop database testbug; create database testbug; use testbug; source mysqlbug10.sql will lead to ERROR 1347 (HY000): 'testbug.testview' is not BASE TABLE Suggested fix: make sure the view is ignored and not handled as a table - it has no extra information if the database structure is kept. The view might even have changed without notice ... [12 Jan 2006 10:14] Valerii Kravchuk Thank you for a problem report. Verified just as described. The real problem is the following. According to the manual (http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html): "--no-create-info, -t Do not write CREATE TABLE statements that re-create each dumped table." But when this option is icnluded for database with views, each views is dumped as follows: -- -- Dumping data for table `testview` -- /*!40000 ALTER TABLE `testview` DISABLE KEYS */; LOCK TABLES `testview` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `testview` ENABLE KEYS */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; While without this option we get: -- -- Table structure for table `testview` -- DROP TABLE IF EXISTS `testview`; /*!50001 DROP VIEW IF EXISTS `testview`*/; /*!50001 DROP TABLE IF EXISTS `testview`*/; /*!500
that make connections all over the world. Join today Community Community Home Getting Involved https://www.drupal.org/node/2261717 Chat Forum SupportPost installation PDOException: SQLSTATE[HY000]: General error: 1347 when trying to set up index or primary key on adopted data table. Posted by http://dba.stackexchange.com/questions/43671/optimize-command-issuing-view-is-not-base-table-and-corrupt-error-messages crazyfly on May 8, 2014 at 8:52am Hi, I'm trying to get data from webforms in a view. Using these modules: webform Webform MySQL is not Views data I choose adopted tables, then I select my desired Webform. Then I go to Edit and I jond de SID with the webform_submissions.sid so I can choose that as PRIMARY KEY. So then I should be able to make reationships in my view and select fields from is not base my webform to show on my view. But when I save after I assign the PRIMARY KEY i'll get this error. PDOException: SQLSTATE[HY000]: General error: 1347 'ID8588_TEST.webform_views_paasstage_2014' is not BASE TABLE: ALTER TABLE {webform_views_paasstage_2014} CHANGE `uid` `uid` INT NOT NULL DEFAULT 0 COMMENT 'The id of the user that completed this submission.'; Array ( ) in db_change_field() (regel 3017 van /data/sites/web/TESTbe/www/includes/database/database.inc). Any Idea? Log in or register to post comments ⋅ Categories: Drupal 7.x News itemsDrupal news Planet Drupal Association news Social media directory Security announcements Jobs Our communityCommunity Getting involved Services, Training & Hosting Groups & Meetups DrupalCon Code of conduct DocumentationDocumentation Drupal 8 docs Drupal 7 docs Developer docs api.drupal.org Drupal code baseDownload & Extend Drupal core Modules Themes Distributions Governance of communityAbout Web accessibility The Drupal Association About Drupal.org Terms of service Privacy policy Drupal is a registered trademark of Dries Buytaert.
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Optimize command issuing “'View is not base table” and “Corrupt” error messages up vote 1 down vote favorite I have no experience with MySQL. My boss ran an optimize against a MySQL database. Against a bunch of views we got the message "tablexyz" is not BASE TABLE and the next has message is Corrupt It seems to be only against views, we didn't get any of these error messages against the base tables. Does this look like an incorrect error message, or do we have issues with our tables? mysql view corruption share|improve this question edited Jun 3 '13 at 18:01 Mat 6,55622234 asked Jun 3 '13 at 10:04 Worried 912 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote You cannot run OPTIMIZE TABLE against a View. I can see why the error message would be Corrupt In mysql, a view is represented as a table in INFORMATION_SCHEMA.TABLES. I have discussed views in this light before However, a View in INFORMATION_SCHEMA.TABLES has NULL as a Storage Engine. Mar 21, 2012 : How do I get the execution plan for a view? Nov 23, 2011 : How can I define the datatype of a view in MySQL? Consequently, there must be a storage engine to optimize on. Since the Storage Engine is NULL, Corrupt error message is understandable. Therefore, don't be concerned with the error message. Just run OPTIMIZE TABLE on the underlying base tables. share|improve this answer edited Jun 3 '13 at 20:23 answered Jun 3 '13 at 20:17 RolandoMySQLDBA 107k15138274 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy a