0

I keep getting a syntax error, I've look at countless examples I'm not sure what the problem is...

DELIMITER //
CREATE PROCEDURE test()
BEGIN
  SELECT *  FROM user;
END //
DELIMITER ;

SCREENSHOT: enter image description here

7
  • There are 6 lines in your SQL code, what do you have on line 7? Commented May 3, 2016 at 8:53
  • @mitkosoft I have nothing underneath that no whitespace or anything... Commented May 3, 2016 at 8:54
  • The code works as a charm in my Navicat. Commented May 3, 2016 at 8:54
  • This code is working fine in mysql work bench. Commented May 3, 2016 at 8:55
  • wth that so weird... Commented May 3, 2016 at 8:57

3 Answers 3

1

Alter procedure and remove delimiter....like below

CREATE PROCEDURE test()
BEGIN
  SELECT *  FROM user;
END
Sign up to request clarification or add additional context in comments.

1 Comment

I get a different error now - "Can't create a PROCEDURE from within another stored routine"
0

Modify the user to [user] as user is reserved keyword

CREATE PROCEDURE test()
BEGIN
SELECT *  FROM [user];
END

Comments

0

I experienced multiple problems when wanting to create a stored procedure in Navicat.

Finally I wrote the CREATE PROCEDURE-statement in the normal query window instead of inside the window to design a function/procedure, and then it worked.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.