Re: Stored Procedure Syntax error.
"Ryan Knopp" wrote ...
>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. Which is expected.
> It seems to have something to do with the BEGIN statement and I can't
> seem to figure it out. Any Suggestions?
delimiter /
CREATE PROCEDURE HAPPINESS (IN player BIGINT, IN turn INT)
BEGIN
UPDATE something SET something=player;
UPDATE something2 set something2=turn;
END;
/
Regards
Dimitre |