Jump to content
Larry Ullman's Book Forums

Stored Procedures


Recommended Posts

I am using Version 3.2.4 of phpMyAdmin and have, apparently, been successful in creating a stored procedure which I called "get_stuff". Now I'm trying to figure out how to CALL it from within the SQL window.

 

 

I found this post by Larry -

 

"I don't know what version of phpMyAdmin I used previously as I just upgraded. I'm now using phpMyAdmin 3.2.5 with PHP 5.3.2 and MySQL 5.1.44. It's using the mysql PHP extension. This time I could call the stored procedures using either the SQL tab or the SQL popup, so long as I named the database--CALL ecommerce2.select_sale_items(1)--and so long as I DID NOT select the database in phpMyAdmin first. In other words, I had to be on the phpMyAdmin home page to start. Clearly, phpMyAdmin is inconsistent about how it deals with stored procedures. "

 

 

So I tried to follow it with:

 

CALL practice2.get_stuff(12);

 

naming the database, as advised, and doing it from the home page of phpMyAdmin. However I get the result:

 

#1312 - PROCEDURE practice2.get_stuff can't return a result set in the given context

 

 

 

 

thanks,

chop

Link to comment
Share on other sites

I found a post that is a couple of years old, but it seems to state that phpMyAdmin cannot handle calling stored procedures. The following is the link to that post:

 

http://tycoontalk.freelancer.com/the-database-forum/117270-phpmyadmin-and-procedures.html

 

After Googling it a bit, it seems like all sites say the same thing: Stored procedures are not supported. If you want to test them, you more or less just need to type out the actual query with some test data.

 

Edit: Stored procedures can be created and edited, but not called from phpMyAdmin.

 

Sorry I can't be of more help, but that's pretty much it.

  • Upvote 1
Link to comment
Share on other sites

Apparently it is possible, I found this post not too long ago at MySQL's forum.

http://forums.mysql.com/read.php?98,415004,415066#msg-415066

 

Also phpMyAdmin has been updated on May 20th, 2011. The current version is 3.4.1

 

I have not used prepared statements so I don't know how well or what limitations there are or what new features the recent versions bring to that capability.

 

Edit:

 

It seems in the last post in that thread someone figured out how to use delimiters within phpMyAdmin to make stored procedures work and call them.

 

http://forums.mysql.com/read.php?98,415004,415210#msg-415210

  • Upvote 1
Link to comment
Share on other sites

In the other forum, the one that chop references, I explicitly state that you can call stored procedures using phpMyAdmin, but how you do so depends upon the versions in use and seems to change.

Link to comment
Share on other sites

Terry: The links you gave seem to be about creating the procedures, which I have done successfully. Calling them from within phpMyAdmin is the problem I now have (as per my last post).

 

thanks for your response,

Chop

Link to comment
Share on other sites

From the last link in my post at the bottom of that post the person gives instruction on how to show the status:

 

In phpMyAdmin select the database and import the file.

 

To see stored procedure created or not enter the below command

 

SHOW PROCEDURE STATUS;

 

Then apparently if you do this it will show the actual result

 

To view the stored procedure,

 

SHOW CREATE PROCEDURE NAME_OF_PROCEDURE;

 

 

Those are quotes directly from the post in that other article, I have not tried them.

Let us know if those commands work for you.

 

 

 

 

Terry: The links you gave seem to be about creating the procedures, which I have done successfully. Calling them from within phpMyAdmin is the problem I now have (as per my last post).

 

thanks for your response,

Chop

Link to comment
Share on other sites

 Share

×
×
  • Create New...