您的位置:首页 > 数据库 > MySQL

mysql存储过程初级

2016-07-27 18:16 405 查看
delimiter//

drop PROCEDURE if EXISTS pr_add;//

create procedure pr_add (a int,b int)

begin

declare c int;

if a i
4000
s null then

set a = 0;

end if;

if b is null then

set b = 0;

end if;

set c = a + b;

select c as sum;

end

call pr_add(10, 20);

    set @a = 10;

    set @b = 20;

    call pr_add(@a, @b);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: