0

I am trying to create stored procedure in mysql but showing following errors..

1064 - 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 '' at line 6

Procedure as bellow..

CREATE PROCEDURE getSchools( IN masterschools_id int )
BEGIN
 select * from masterschools where id =masterschools_id;
END
Community
  • 1
  • 1
Dinesh Vaitage
  • 2,983
  • 19
  • 16
  • Try setting delimiter to $$ before the create - don't forget to set it back to whatever your current settings are after the end statement. If you have mysql workbench you can have it generate the right code for you... – P.Salmon May 03 '16 at 08:27

1 Answers1

0

Tried this and its working properly...

 create DEFINER=products@localhost procedure getMyschools ()
  NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER
select * from masterschools;
Dinesh Vaitage
  • 2,983
  • 19
  • 16