Stored Procedure
-
Hello Friends, I'm creating procedures as the code below but it's raising an problem. DELIMITER $$ DROP PROCEDURE IF EXISTS `SP_Select` $$ CREATE PROCEDURE `SP_Select` (id int) BEGIN Select ID from Rough where ID=id END $$ DELIMITER ; Here is the error i'm getting shown below Script line: 3 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 'END' at line 3
-
Hello Friends, I'm creating procedures as the code below but it's raising an problem. DELIMITER $$ DROP PROCEDURE IF EXISTS `SP_Select` $$ CREATE PROCEDURE `SP_Select` (id int) BEGIN Select ID from Rough where ID=id END $$ DELIMITER ; Here is the error i'm getting shown below Script line: 3 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 'END' at line 3
You need to study your SQL Syntax's..... The error from your stored procedure is on the line "Select ID from Rough Where ID =id " that line should end with a semicolon.....and hence should read "Select ID from Rough Where ID =id;" The Stored procedure should look something like this DELIMITER $$ DROP PROCEDURE IF EXISTS `SP_Select` $$ CREATE PROCEDURE `SP_Select` (id int) BEGIN Select ID from Rough where ID=id; END $$ DELIMITER ;