MySQL Forums
Forum List  »  Stored Procedures

syntax error.
Posted by: Ryan Knopp
Date: December 21, 2006 01:31PM

I have this statement in a SQL file.

CREATE PROCEDURE HAPPINESS (IN player BIGINT, IN turn INT)
BEGIN
     UPDATE something SET something=player;
     UPDATE something2 set something2=turn;
END;

When I run this command
bash$ mysql -p table < storedprocedure.sql

I get this error.
ERROR 1064 (42000) at line 1: 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 something SET something=player;' at line 3

If i take out the BEGIN and END it works fine but only includes the first UPDATE statement. The second one get ommited. IT seems to have something to do with the BEGIN statement and I can't seem to figure it out. Any Suggestions?

Options: ReplyQuote


Subject
Views
Written By
Posted
syntax error.
2408
December 21, 2006 01:31PM
1060
December 21, 2006 03:02PM


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.