Mysql syntax error

DELIMITER //

CREATE PROCEDURE profile_update(
		IN @stat VARCHAR(1), 
		IN @fname VARCHAR(50), 
		IN @lname VARCHAR(50), 
		IN @email VARCHAR(120), 
		IN @org VARCHAR(120), 
		IN @phone VARCHAR(14), 
		IN @other VARCHAR(120), 
		IN @time VARCHAR(120), 
		IN @state VARCHAR(120), 
		IN @street VARCHAR(200), 
		IN @city VARCHAR(50), 
		IN @back VARCHAR(50), 
		IN @gender VARCHAR(1), 
		IN @day DATE, 
		IN @me INT(11)
	)

	BEGIN	
		
		DECLARE EXIT HANDLER FOR SQLEXCEPTION
			BEGIN
				SELECT "Unable to update profile" AS error;
				ROLLBACK;
			END;
		

		START TRANSACTION;
				
			UPDATE players
			SET 
				status = @stat, 
				first_name = @fname, 
				last_name = @lname, email = @email, phone = @phone, other = @other, 
				gender = @gender, background = @back, street = @street, city = @city, birthday = @day, 
				timezone = ( SELECT t.id FROM `internal-timezones` AS t WHERE t.zone = @time LIMIT 1 ),
				countryId = ( SELECT c.id FROM `internal-countries` AS c WHERE c.id = @state LIMIT 1 )
			WHERE id = @me AND email = @org
			LIMIT 1;
			
			INSERT INTO players_activity_log ( date, playerId, table_name, table_id ) VALUES ( NOW(), @me, "players", @me );
		
		COMMIT;

	END //

DELIMITER ; 

Open in new window


Hi,

I cannot for the life of me see the error here?

Error:
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' at line 1

thanks for your help
LVL 6
J NUnicorn wranglerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brian DayhoffSenior Full Stack DeveloperCommented:
It is interpreting your delimiter as a comment, which resolves to the compiler as an empty delimiter statement. Do not use any of the following as delimiters:

//

/*

*/

#

--

If you have content that has to be separated by one of these, you need to run a pre or post filter at the application level, such as with python or java to run conversion prior to sql generation.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PortletPaulEE Topic AdvisorCommented:
Try it with

DELIMITER \\
...
END \\
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.