Surprising that I couldn't cut and paste from SQuirreL-SQL to phpMyAdmin when using sprocs. But then if you think about it for a second, it makes a lot of sense -- the parser in phpMyAdmin stops at a semi-colon and, Emeril-style, BAM! It runs it.

You've got to change your delimiter.

Nth Design ยป Using phpMyAdmin to Create Stored Procedures:
1 Open phpMyadmin.
2 Select a database to work with.
3 Open the SQL tab.
4 Select all of the SQL statements between the DELIMITER statements in your stored procedure script. Do not include the DELIMITER statements!

Hereโ€™s what my example script should look like:

DROP PROCEDURE IF EXISTS spFoo $$

CREATE PROCEDURE spFoo ()
BEGIN
SELECT 'Foo' FROM DUAL;
END $$


5 In the delimiter field, just below the SQL editorโ€™s text area, enter $$ as your delimiter.


So that delimiter spot is here:


Below "sig" from the Chrome BlogThis extension. I don't think Pyra's link ever did this. I'll leave it this time, Google, but I'm not using that extension again unless I'm really bored and have Chrome's bookmark toolbar off again.

'via Blog this'

Labels: , ,