mySQL存储过程创建报错,请大家帮我看看! 10

CREATEPROCEDURE`P_Mis_GetAccess`(param_UserIDint,param_MenuIDint,outparam_Access_IDin... CREATE PROCEDURE `P_Mis_GetAccess`(
param_UserID int,
param_MenuID int,
out param_Access_ID int,
out param_Access_Name varchar(50),
out param_Access_CanRead varchar(6),
out param_Access_CanEdit varchar(6),
out param_Access_CanCheck varchar(6),
out param_Access_CanAdmin varchar(6)
)
Begin
DECLARE param_temp1 int default 0;
DECLARE param_temp2 int default 0;

select Access_ID into param_temp1 from t_Mis_Sys_AccessCode
where Access_ID=(select max(Access_Level) from t_Mis_Sys_RoleAccess where Access_Role in (
select Role_ID from t_Mis_Sys_Role where (select User_IsDeleted from t_Mis_Sys_User where User_ID= param_UserID )='F'
and Role_ID in (select Role_ID from t_Mis_Sys_UserRole where User_ID= param_UserID )
and Role_ID in (select Role_ID from t_Mis_Sys_Role where Role_ID in (select Role_id from t_Mis_Sys_UserRole where User_ID= param_UserID ) and Role_IsDeleted='F'))
and Access_Menu= param_MenuID );

select Access_ID into param_temp2 from t_Mis_Sys_AccessCode
where Access_ID=(select Access_LevelID from t_Mis_Sys_UserAccess where Access_UserID= param_UserID
and (select User_IsDeleted from t_Mis_Sys_User where User_ID= param_UserID )='F'and Access_MenuID= param_MenuID );

if param_temp2>param_temp1 then
set param_temp1=param_temp2;
end if;

select Access_ID into param_temp2 from t_Mis_Sys_AccessCode
where Access_ID=(select max(Com_LevelID) from t_Mis_SysCommision where Com_GetID=param_UserID
and (select User_IsDeleted from t_Mis_Sys_User where User_ID= param_UserID )='F'
and Com_MenuID= param_MenuID and now()>Com_StartTime and now()<Com_EndTime);

if param_temp2>param_temp1 then
set param_temp1=param_temp2;
end if;

select Access_ID,Access_Name,Access_CanRead,Access_CanEdit,Access_CanCheck,Access_CanAdmin
into param_Access_ID,param_Access_Name,param_Access_CanRead,param_Access_CanEdit,param_Access_CanCheck,param_Access_CanAdmin
from t_Mis_Sys_AccessCode where Access_ID=param_temp1;
End;

执行后报报“ 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 12”
请大家帮我看看是什么问题,如何解决?
展开
 我来答
百度网友0f37e23c0
2009-09-23 · TA获得超过1543个赞
知道大有可为答主
回答量:1070
采纳率:50%
帮助的人:1300万
展开全部
请检查你的mysql版本,5.0以下版本不支持存储过程,视图,自定义函数及游标的。linux命令rpm -qa | grep mysql可查看mysql版本。
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式