"Jeff" <EMAIL REMOVED> wrote:
>
> CREATE PROCEDURE SaveProperty()
> BEGIN
> DECLARE @var1 INT;
> END;
>
> ERROR 1064 (42000): 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 '@var1 INT' at line 3
> Any suggestions to what I'm doing wrong are welcome!
You're trying to declare a user variable. User variables have names
starting with @ and must not be declared. The scope of a user variable
is the connection, the scope of a local variable is the surrounding
BEGIN ... END block. Local variable names must not start with @.
Try this:
CREATE PROCEDURE SaveProperty()
BEGIN
DECLARE var1 INT;
END;
XL
--
Axel Schwenke, Support Engineer, MySQL AB
Online User Manual:
http://dev.mysql.com/doc/refman/5.0/en/
MySQL User Forums:
http://forums.mysql.com/