Mysql 数据库学习笔记03 存储过程

一、存储过程:如下           通过 out 、inout 将结果输出,可以输出多个值。

   

       * 调用存储过程:

     call 存储名称(参数1,参数2,...); 如指定参数不符合要求,返回 Empty Set

    

   * 查询存储过程的状态: show procedure /function   status like '名称'  G;

          

    *查看存储过程的具体信息:  show  create procedure/fucntion 名称 G;

      

    *查看所有的存储过程:select * from information_schema.Routines where routine_name = "finduser";  没有where是查询所有

    * 修改存储过程  :alter procedure/function 名称 characteristic..   如:

      修改finduser 将读写权限修改为 modifies sql data,并且指明调用者可以执行

      

     * 删除 存储过程: drop procedure 名称;

例子:创建一个 循环 插入7条数据的 存储过程。

 如果有 in 和 out 参数,out要用@修饰,如 call 调用是    (5,@name)

   

 

       

原文地址:https://www.cnblogs.com/GotoJava/p/6733974.html