Bug #24743 Create View error
Submitted: 1 Dec 2006 4:26 Modified: 1 Dec 2006 21:05
Reporter: Shaine MaGuire Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:5.1.11 OS:Windows (Win XP Home)
Assigned to: CPU Architecture:Any
Tags: catelogs, createview, VIEW, Views

[1 Dec 2006 4:26] Shaine MaGuire
Description:
Attempting to create a view of a table that exists.

How to repeat:
1) Login to MySQL Administrator
2) Click on Catelogs
3) Click Views Tab
4) Click "Create View" button
5) Enter in a name called Test
6) Click "Create View" button
7) MySQL Editor will then show "CREATE OR REPLACE VIEW `YOURTABLENAMEHERE`.`Test` AS SELECT"
8) Click "Execute SQL" button

Error as follows:
Error while executing query:
CREATE OR REPLACE VIEW `YOURTABLENAMEHERE`.`Test` AS SELECT

MySQL Error Number 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near " at line 1.

Suggested fix:
I have no clue.  I even tried the table name  and it produced the same error as above.
[1 Dec 2006 9:51] Sveta Smirnova
Thank you for the report.

Are you trying to execute query "CREATE OR REPLACE VIEW `YOURTABLENAMEHERE`.`Test` AS SELECT"?
[1 Dec 2006 12:12] Shaine MaGuire
yes, as step 8 says... when i click on the execute sql button is when i get the error.  i have never used that part before.  i am starting to get into sql and mysql and want to learn as much as i can.  i dont even know what this does and was interested to know.
[1 Dec 2006 13:27] Valeriy Kravchuk
What exect version of MySQL Administrator do you use?
[1 Dec 2006 18:04] Shaine MaGuire
Version:     5.1.11
 OS:          Win XP Home
[1 Dec 2006 20:09] Sveta Smirnova
If you really issue query "CREATE OR REPLACE VIEW `YOURTABLENAMEHERE`.`Test` AS SELECT" error message "MySQL Error Number 1064....." is expected, because you really have error in SQL syntax. MySQL Administrator creates only template of CREATE VIEW query, you should write correct query by self.
[1 Dec 2006 20:44] Shaine MaGuire
I didnt know that and that is very new to me.  So if i wanted to do a view on a table would it be something like:

CREATE VIEW YOURTABLENAME.YOURTABLE AS SELECT?
[1 Dec 2006 21:05] Shaine MaGuire
its ok, i found it here http://dev.mysql.com/doc/refman/5.0/en/create-view.html :)