DROP PROCEDURE IF EXISTS test_delimiter;
DELIMITER //
CREATE PROCEDURE test_delimiter()
BEGIN
END//
DELIMITER ;
When I try to run them in Squirrel, I get:
Error: 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 'DELIMITER //
CREATE PROCEDURE test_delimiter()
BEGIN
END//
DELIMITER' at line 1
SQLState: 42000
ErrorCode: 1064
Error occured in:
DELIMITER //
CREATE PROCEDURE test_delimiter()
BEGIN
END//
DELIMITER
Any ideas why?
Also, it would be great to have Cloud SQL support MySQLWorkbench. Is
there a way to connect the two?
DROP PROCEDURE IF EXISTS test_delimiter;
CREATE PROCEDURE test_delimiter()
BEGIN
SELECT * FROM my_table;
END;
I get:
Error: 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 3
SQLState: 42000
ErrorCode: 1064
Error occured in:
CREATE PROCEDURE test_delimiter()
BEGIN
SELECT * FROM my_table
So how do I create a multi SQL statement procedure or function using
Squirrel? Also, it would be nice to have SQL that works in both
MySQLWorkbench and Squirrel.
The "MySQL Plugin" fixes the issue and I can now create functions and
procedures using Squirrel.
The "MySQL Plugin" was tricky to install on OS X. The Squirrel
installer wasn't showing checkmarks as I clicked next to optional
plugins. The first time I would click on an optional plugin, it
wouldn't show as selected (no highlight in blue or checkmark).
Sometimes, the second time I clicked, the checkmark would appear.
After installing Squirrel a few times, I noticed that optional plugins
(with checkmarks) were not being installed. The solution to that was
for me to only click on optional plugins in the installer once and
even though a checkmark did not appear, they apparently were selected
and installed. I was able to see that this worked using the Squirrel
Plugins / Summary menu item.
On Dec 2, 3:45 am, Giovanni Mascia <gmas...@google.com> wrote:
> Apologize - DELIMITER is actually a client thing, so a given client might
> not support it.
>
> Apparently, to have it supported in Squirrel, you need to enable the
> so-called "MySql Plugin" - by default, Squirrel is not able to parse
> procedure statements.
>
>
>
>
>
>
>
> On Fri, Dec 2, 2011 at 12:27 PM, Giovanni Mascia <gmas...@google.com> wrote:
> > Rob: DELIMITER is a proper SQL command that you use to change the char to
> > be used as a delimiter. Since ';' is the default delimiter, one typically
> > changes it to something else i.e. '//' to have the freedom to use ';' in
> > multiline procedures as single-line delimiter (as opposed to // to be used
> > as a procedure delimiter). So it should be understood and properly passed
> > by every mysql client.
>
> > Philip: I think you have a syntax error in your example. If you try
> > something classic like this, it should definitely work:
>
> > DELIMITER //
> > CREATE PROCEDURE test_delimiter()
> > BEGIN
> > SELECT * FROM MY_TABLE;
> > END//
> > DELIMITER ;
>
> > I confess I did try this only in the google_sql tool, but there's no
> > reason why Squirrel should not accept it, since the MySql engine does.
>