存储过程 、函数和事务

创建存储过程:

1 delimiter //
2 create procedure printname (id int,out name char(50) )
3 begin
4 select user into name from user where id=id;
5 end
6 //
7 delimiter ;
View Code

调用存储过程:

1 call printname(1,@a);
2 select @a;
View Code

创建函数:

1 delimiter //
2 create function hi(s char(20)) returns char(50)
3 return concat('hello,',s,'l');
4 //
5 delimiter;
View Code

调用函数:

1 select hi('world!');
View Code
原文地址:https://www.cnblogs.com/canbefree/p/3741822.html