Why Am I Getting MySQL Error #1312 when Using a Simple Stored Procedure?
Posted
by Laxmidi
on Stack Overflow
See other posts from Stack Overflow
or by Laxmidi
Published on 2010-05-16T01:09:23Z
Indexed on
2010/05/16
1:10 UTC
Read the original article
Hit count: 346
mysql
|stored-procedure
Hi,
I'm 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 delimiter. The real version has the name of an actual table instead of myTable.).
But, when I call the procedure with CALL SimpleProc();
, I get error "#1312 - PROCEDURE mydb.SimpleProc can't return a result set in the given context".
I read that some versions of php or phpMyAdmin won't work with stored procedures.
I'm using a localhost running on a Mac with MAMP 1.9. I've got MySQL 5.1.44, PHP 5.2.13 & 5.3.2, phpMyAdmin 3.2.5. Does anyone know if stored procedures will work with my set-up? Am I doing something incorrectly? Any advice?
Shout out to the Big Red for a triple overtime victory in Lax.
Thanks, Laxmidi
© Stack Overflow or respective owner