Why am I getting MySQL error # 1312 when using a simple stored procedure?

I am trying to learn how to use MySQL stored procedures. MySQL accepted my procedure:

CREATE PROCEDURE SimpleProc() BEGIN SELECT * FROM myTable; END 

(In phpMyAdmin, I set // for the delimiter. The real version has the name of the actual table instead of myTable.).

But when I call the procedure using CALL SimpleProc(); , I get the error "# 1312 - PROCEDURE mydb.SimpleProc cannot return the result set in this context."

I read that some versions of php or phpMyAdmin will not work with stored procedures.

I am using localhost running on Mac with MAMP 1.9. I have MySQL 5.1.44, PHP 5.2.13 and 5.3.2, phpMyAdmin 3.2.5. Does anyone know if stored procedures will work with my setup? Am I doing something wrong? Any tips?

Shout out to Big Red for a triple victory at Lakes.

Thanks Laxmidi

+4
source share
1 answer

Yes, it seems that in some older versions of phpMyAdmin there is an error that can lead to the error 1312 that you get. This can happen when calling stored procedures containing SELECT from phpMyAdmin.

For further reading, you can check the following entries:

This error only affects phpMyAdmin, and you can still call the stored procedure from anywhere.

+3
source

Source: https://habr.com/ru/post/1309889/


All Articles