|
DELIMITER $
Create PROCEDURE recharge (PName varchar(100),gold int(10))
BEGIN
set @AName=CONCAT('1-',PName);
set @AccountID=(select AccountID from avatar where rolename=@AName);
update avatar set Diamond=Diamond+gold where RoleName=@AName;
update account set RechargeTotal=RechargeTotal+gold where AccountID=@AccountID;
end$
delimiter ; |
|