I’m messing around with stored procedures for the first time, but can’t even create a simple select! I’m using phpMyAdmin and this is my SQL:
DELIMITER //
CREATE PROCEDURE test_select()
BEGIN
SELECT * FROM products LIMIT 10;
END //
DELIMITER ;
After submitting that, my localhost does some thinking for a loooong time and eventually loads a page with no content called /phpmyadmin/import.php. After reloading phpMyAdmin and trying to invoke the procedure:
CALL test_select();
I get a “PROCEDURE doesn’t exist” error. Any ideas?
Try to use the delimiter field of phpMyAdmin, as shown in the screenshot below:
Simply put the following in the query window:
In addition note that there is bug in some older versions of phpMyAdmin, which can cause an error when you call stored procedures that contain
SELECTstatements from phpMyAdmin.You may want to check out the following posts for further reading:
This bug effects only phpMyAdmin, and you would still be able to call the stored procedure from anywhere else.