标签:in out rop signed cat sel ida drop sts 地址
DELIMITER $$ USE `tongliaograin`$$ DROP PROCEDURE IF EXISTS `A_Sys_GetAdminValidate`$$ CREATE DEFINER=`root`@`%` PROCEDURE `A_Sys_GetAdminValidate`(IN `sLoginName` VARCHAR(100),IN `sPassword` VARCHAR(100),IN `sIP` VARCHAR(100)) BEGIN DECLARE nNum INT DEFAULT 0; DECLARE nAdminID INT DEFAULT 0; DECLARE slogcontent VARCHAR(100) DEFAULT ""; SELECT * FROM sys_admin WHERE LoginName = sLoginName AND `password`=sPassword; SELECT COUNT(*) INTO nNum FROM sys_admin WHERE LoginName = sLoginName AND `password`=sPassword; IF(nNum > 0) THEN SELECT CAST(AdminID AS SIGNED) INTO nAdminID FROM sys_admin WHERE LoginName = sLoginName AND `password`=sPassword; SET slogcontent = CONCAT(‘【用户登录】后台用户:‘,sLoginName,‘IP地址为:‘,sIP,‘ 登录成功‘); CALL A_SysLog_Add(12,nAdminID,slogcontent); END IF; END$$ DELIMITER ;
1、开头和结尾需要用到 DELIMITER $$ 和 DELIMITER ;
2、存储过程参数,必须有in out inout ,参数名必须用 “·”符号包起来,而且必须声明参数类型及其长度
标签:in out rop signed cat sel ida drop sts 地址
原文地址:https://www.cnblogs.com/zyc19910109/p/9831087.html