Mysql存储过程报1064错误,提示语法错误?
CREATEPROCEDURE`my_record_report`(INDaytedatetime)#Routinebodygoeshere...BEGIN(DECLAR...
CREATE PROCEDURE `my_record_report`(IN Dayte datetime) #Routine body goes here...BEGIN(DECLARE dt_n datetime DEFAULT now(); DECLARE i INT; WHILE(i<24) do { dt_n=DATE_ADD('Dayte',INTERVAL '1 01:00:00',DAY_SECOND); select COUNT FROM precord_view_luyin WHERE `开始时间` BETWEEN Dayte AND dt_n; RETURN COUNT; }END WHILE;)ENDMYSQL5.5版本,始终说语法错误。但不知道哪里错了。使用的是Navicat
展开
1个回答
展开全部
DELIMITER //
DROP PROCEDURE IF EXISTS count_role;
CREATE PROCEDURE `count_role`(in p_role_name varchar(20),out count_total int,out exe_date date)
BEGIN
select count(*) into count_total from t_role where role_name like '%' || p_role_name || '%';
select sysdate into exe_date from dual;
END;
//
DELIMITER ;
DROP PROCEDURE IF EXISTS count_role;
CREATE PROCEDURE `count_role`(in p_role_name varchar(20),out count_total int,out exe_date date)
BEGIN
select count(*) into count_total from t_role where role_name like '%' || p_role_name || '%';
select sysdate into exe_date from dual;
END;
//
DELIMITER ;
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询