PDA

View Full Version : phpMyAdmin vs Stored Procedures


nabelrock
25-08-2007, 04:33
Hi everyone, I'm back again with a problem :)

I'm trying to compile a stored procedure in MySQL 5 through phpMyAdmin, but as simple as my stored proc is, still I encounter an error. Please see details below:

here's my SP:
CREATE PROCEDURE sp_test() BEGIN SELECT 'Hello'; END;

here's the error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 'Hello'' at line 1

Versions I am using:
phpMyAdmin 2.6.3-pl1
MySQL 5.0.24

is it a problem with phpMyAdmin? Help and suggestions are very much appreciated, thanks!

Oops!
25-08-2007, 10:46
My first guess is that you do not have a 'FROM table' in your routine_body. Without that by itself, SQL probably cannot select anything.

That is also assuming that you do have a column called 'Hello'.

Not sure if i'm right.

nabelrock
25-08-2007, 16:08
Hi there, actually this "SELECT 'Hello';" will just print out the word "Hello", works well with MySQL Query browser, but doesnt go through for phpMyAdmin, seems like phpMyAdmin does not support the "CREATE PROCEDURE" keyword, has anyone experienced the same thing? or has anyone ever compiled a stored proc via phpMyAdmin to a MySQL 5 database?

Thanks so much!

My first guess is that you do not have a 'FROM table' in your routine_body. Without that by itself, SQL probably cannot select anything.

That is also assuming that you do have a column called 'Hello'.

Not sure if i'm right.

yoshikawasaki
03-09-2007, 03:02
Hi NabelRock,

I'm unsure of the more recent phpMyAdmin versions but from previous experience with phpMyAdmin and mySQL 5, I would say that it might be a phpMyAdmin problem.

i.e. I had problems administering mySQL using phpMyAdmin. In the end, I went back to the good old command line.

Yoshi..

nabelrock
14-09-2007, 14:40
yep, confirmed that phpMyAdmin got problems for compiling stored procs.

I found another 3rd party query browser SQLYOG, quite good I may say