Mysql Database Event and Procedure(3)Stored Procedure

Mysql Database Event and Procedure(3)Stored Procedure

Grammar
create procedure Name()
(
[in|out|inout] variable datatype
)
begin
     mysql statements;
end;

examples:
CREATE procedure p2(p INT) SET @x = p;

CALL p2(123);

SELECT @X;

define procedure, set user variable in procedure; call procedure; select the user variable

Comments
/* this is comments
   across multiple lines
*/
- - single line comments

This blog can be used as reference for grammar
https://yq.aliyun.com/articles/20804

References:
http://www.jianshu.com/p/1cb06d5eda09
https://yq.aliyun.com/articles/20804

猜你喜欢

转载自sillycat.iteye.com/blog/2343273
今日推荐