0

I have tried the following code with and without a delimiter in phpmyadmin. It seems to reject the delimiter when I have present.

I am using 1 and 1 hosting and the MySQL version is 5.0

The error code I specifically get is #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 '' at line 3

CREATE PROCEDURE add_person_type_procedure(Person_Type_Value_Description VARCHAR(150) , Create_Date DATETIME ,  Modify_Date DATETIME , Archive CHAR(1))
BEGIN
DECLARE ID VARCHAR(36);
SET ID = (SELECT UUID());
END;
hjpotter92
  • 78,589
  • 36
  • 144
  • 183
Robin
  • 69
  • 1
  • 7

1 Answers1

0

http://dev.mysql.com/doc/refman/5.1/en/stored-programs-defining.html

I think you need "set @ID=..."

ethrbunny
  • 10,379
  • 9
  • 69
  • 131
  • thank you for your reply. I had missed out the @, but the error message is still present. Do you know of anything else it may be? – Robin Apr 20 '12 at 15:39
  • I really think you need to use a 'delimiter //' or equivalent. – ethrbunny Apr 20 '12 at 15:43
  • with a delimiter I get this error instead: #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 'DELIMITER //' – Robin Apr 20 '12 at 16:01
  • You have some larger issue then. That's a pretty basic command. What are you using to edit your procedure? – ethrbunny Apr 20 '12 at 17:15
  • I'm trying to create the procedure, I am using phpmyadmin, it is for a website using mysql/php – Robin Apr 20 '12 at 17:20
  • check the mysql version. Its possible with phpMyAdmin but might be more exciting. – ethrbunny Apr 20 '12 at 19:10
  • thanks, I did extensive research and contacted my host provider, turns out phpmyadmin does support it, and so does my version of mysql, but my host version of phpmyadmin (1 and 1) make it a pain to use them. – Robin Apr 21 '12 at 12:37