MySQL Forums
Forum List  »  Stored Procedures

Re: Create Stored Procedure Issues with PhpMyAdmin
Posted by: Nate Smith
Date: February 13, 2009 12:49PM

The following scenario works for me when creating stored procedures in phpMyAdmin.

Scenario for Command Line
-------------------------
What if I had a SQL script like this:

/* Start Command Line Script */
DELIMITER $$

DROP PROCEDURE IF EXISTS spTest $$
CREATE PROCEDURE spTest ()
BEGIN

SELECT 'Test' FROM DUAL WHERE 1=1;

END $$

DELIMITER ;
/* End Command Line Script */


Scenario for phpMyAdmin
-----------------------
If I wanted to run the above script in phpMyAdmin, I could do so in the following manner:

1. Go to any SQL tab in phpMyAdmin.
2. Directly below the SQL text area you'll see a text input labeled "Delimiter." In that field, enter "$$". This is the delimiter I was trying to use in the example above.
3. I can then paste in this slightly-modifed SQL script. Notice, I've removed the DELIMITER statements. phpMyAdmin handles that for me.

/* Start phpMyAdmin Script */
DROP PROCEDURE IF EXISTS spTest $$
CREATE PROCEDURE spTest ()
BEGIN

SELECT 'Test' FROM DUAL WHERE 1=1;

END $$
/* End phpMyAdmin Script */


Using this method, you can easily create and modify stored procedures in phpMyAdmin.

-Nate

Options: ReplyQuote




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.