3

How do I write a stored procedure in phpMyAdmin?

Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
Bharanikumar
  • 25,457
  • 50
  • 131
  • 201

2 Answers2

5

In phpMyAdmin you can create the stored procedure in the SQL window.

You may have to set the delimieter to something like "$$" instead of the default ";". You can change this from the bottom of the SQL window.

Stored Procedure in phpMyAdmin

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
  • Thanks ...now my sp excuting without Error... How to call the my sp in phpmyadmin, i did somthing like call productpricing(); and then i hit the GO button , suddenly page get refreshed, that's it...nothing happen.... – Bharanikumar Mar 23 '10 at 10:45
  • To call the stored procedure, simply type `CALL mySproc();` in the SQL window and then hit the GO button. – Daniel Vassallo Mar 23 '10 at 10:49
  • 1
    I GOT THIS ERROR #1312 - PROCEDURE ukatn_qa.show_my_country can't return a result set in the given context – Bharanikumar Mar 23 '10 at 11:00
  • Unfortunately this is bug in older versions of phpMyAdmin. It looks like you need to upgrade your phpMyAdmin. Check out the following post: http://stackoverflow.com/questions/2360371/. This bug effects only phpMyAdmin. You would still be able to call the stored procedure from anywhere else (from php, or from the MySql CLI). – Daniel Vassallo Mar 23 '10 at 11:11
1

Copied from the internets:

The answer is yes and no. Phpmyadmin has no tools for creating stored procedures but you can enter in SQL using it and in that way create them.

(Note I don't believe versions prior to MySQL 5 supported stored procedures.)

Barrie Reader
  • 10,647
  • 11
  • 71
  • 139