MySQL Forums
Forum List  »  Newbie

CREATE FUNCTION
Posted by: Quinn Gil
Date: June 13, 2005 11:23PM

I'm trying to use CREATE FUNCTION through the phpMyAdmin interface and am having a lot of trouble getting it to work. The function that is in another MySQL DB but put there through MyMaestro. I had that function's SQL exported from MyMaestro and I try to run that code through phpMyAdmin, like I did for the table creation and it won't work, which it did for the tables.

A sample of the exported code is this

========
CREATE FUNCTION `aplus`.`update_user_login`(`employee_id` INTEGER, `passphrase` VARCHAR(50)) RETURNS tinyint(4)
BEGIN
UPDATE user_login SET
user_login.employee_id = employee_id,
user_login.passphrase = passphrase
WHERE user_login.employee_id = employee_id;
RETURN NULL;
END
========

What is wrong with this code to make it not run through phpMyAdmin?

I know this is probably more of a phpMyAdmin question, but I suspsect some people here use that too.

My system specs are WinXP_SP2, IIS5, MySQL 5.latest, phpMyAdmin latest, and I am trying to run the commands through IE and FireFox, neither works

The SQL shown and the error I get is:
========
SQL query:

CREATE FUNCTION `aplus`.`update_user_login` (
`employee_id` INTEGER,
`passphrase` VARCHAR( 50 )
) RETURNS tinyint( 4 ) BEGIN UPDATE user_login SET user_login.employee_id = employee_id,
user_login.passphrase = passphrase WHERE user_login.employee_id = employee_id

MySQL said: Documentation
#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 'UPDATE user_login SET
user_login.employee_id = employee_id,
user_login.pas' at line 3
========

Any help is greatly appreciated. I don't need a direct answer, though those are always good. :) A good resource works too. I've been trying things for about 5 hours now and nothing I can think of will make these work. The sample 'hello' function from the documentation works, so I know that the creating function aspect works. I have the permissions to do that (root).

Thanks again
Quinn

Options: ReplyQuote


Subject
Written By
Posted
CREATE FUNCTION
June 13, 2005 11:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.