Home  >  Article  >  Database  >  How to Create Stored Procedures in phpMyAdmin Without a Delimiter Option?

How to Create Stored Procedures in phpMyAdmin Without a Delimiter Option?

DDD
DDDOriginal
2024-11-01 03:35:28610browse

How to Create Stored Procedures in phpMyAdmin Without a Delimiter Option?

Stored Procedures in phpMyAdmin: A Workaround

For those managing MySQL databases through phpMyAdmin, the lack of a native delimiting option for creating stored procedures can be a hindrance. However, there is a workaround to manually set the anchor and execute the procedure creation statement.

To achieve this, follow these steps:

  1. Access phpMyAdmin and select your database.
  2. Navigate to the SQL tab.
  3. Copy the MySQL statement that creates the procedure, ensuring to remove the DELIMITER statements.
  4. In the delimiter field located just below the SQL editor, enter $$ as your delimiter.
  5. Paste the edited SQL statement into the editor and click "Go."

Here's an example of the modified SQL statement:

DROP PROCEDURE IF EXISTS spFoo;
CREATE PROCEDURE spFoo ()
BEGIN
    SELECT 'Foo' FROM DUAL;
END;

By following these steps, you can successfully create stored procedures in phpMyAdmin even without the nativeDELIMITER option. For further guidance, refer to the following resource:

[http://blog.nth-design.com/2009/02/25/creating-sp-in-phpmyadmin/](http://blog.nth-design.com/2009/02/25/creating-sp-in-phpmyadmin/)

The above is the detailed content of How to Create Stored Procedures in phpMyAdmin Without a Delimiter Option?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn