MySQL Forums
Forum List  »  MySQL Query Browser

Re: Query Browser Tool !!!
Posted by: Mike Lischke
Date: October 14, 2005 01:06AM

hi jacker wrote:

> Cause, when i try to run this code at the "MySQL
> Query Browser" or another mySQL query tool:
>
> DELIMITER |
> DROP PROCEDURE IF EXISTS sp_declare\G|
> I get several errors.

Actually I get only one error and it clearly states: "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 '\G' at line 1". So it is obvious the \G is the culprit. Next thing is that it does not make any sense to have the "go" delimiter and and the normal delimiter in one line. Actually, the "go" delimiter (\g and \G) does not make any sense in general because we have the normal delimiter. I'd strongly recommend to avoid \g and \G, it isn't even supported in MySQL Query Browser.

> BUT, if i paste this inside the mySQL console it
> works FINE !

It does not. I get:

mysql> use test;
Database changed
mysql> DELIMITER |
mysql> DROP PROCEDURE IF EXISTS sp_declare\G|
Query OK, 0 rows affected (0.00 sec)

ERROR:
No query specified

mysql> CREATE PROCEDURE sp_declare (P INT)
-> BEGIN
-> DECLARE x INT;
-> DECLARE y INT DEFAULT 10;
-> SET x = P*y;
-> SELECT x;
-> END|
Query OK, 0 rows affected (0.00 sec)

mysql> DELIMITER ;
mysql>

See the ERROR in the middle?

Mike

Mike Lischke, MySQL Developer Tools
Oracle Corporation

MySQL Workbench on Github: https://github.com/mysql/mysql-workbench
On Twitter: https://twitter.com/MySQLWorkbench
On Slack: mysqlcommunity.slack.com (#workbench)
Report bugs to http://bugs.mysql.com
MySQL documentation can be found here: http://dev.mysql.com/doc/refman/8.0/en/

Options: ReplyQuote


Subject
Written By
Posted
October 13, 2005 02:49PM
Re: Query Browser Tool !!!
October 14, 2005 01:06AM
October 14, 2005 01:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.