我的程序没有被创建...给出错误
[SQL]CREATE DEFINER = `root``%` PROCEDURE `sp_getemployee`(IN _ulbid INT , IN _designationid INT)
BEGIN
DECLARE queryString VARCHAR(500);
[Err] 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 3
SP就是这样的。
CREATE DEFINER = `root``%` PROCEDURE `sp_getemployee`(IN _ulbid INT , IN _designationid INT)
BEGIN
DECLARE queryString VARCHAR(500);
SET queryString = CONCAT('select
empid,empnumber,designationid,namee,namer,mobileno,isactive from employee where ulbid= ', _ulbid);
IF _designationid != 0 THEN
SET queryString = CONCAT(queryString , ' and designationid= ', _designationid);
END IF;
PREPARE stmt FROM queryString;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END;
绝对不知道我哪里出错了,有人可以帮我解决一下