mysql 查询数据库中的存储过程与函数的语句
程序员文章站
2023-12-15 14:34:10
方法一: select `name` from mysql.proc where db = 'your_db_name' and `type` = 'procedure'...
方法一:
select `name` from mysql.proc where db = 'your_db_name' and `type` = 'procedure' //存储过程
select `name` from mysql.proc where db = 'your_db_name' and `type` = 'function' //函数
方法二:
show procedure status; //存储过程
show procedure status where db='servant_591up'
show function status; //函数
查看存储过程或函数的创建代码
show create procedure proc_name;
show create function func_name;
查看视图
select * from information_schema.views //视图
select * from information_schema.tables //表
查看触发器
方法一:
语法:show triggers [from db_name] [like expr]
实例:show triggers\g //触发器
方法二:
对information_schema数据库中的triggers表查询
mysql>select * from triggers t where trigger_name=”mytrigger” \g
select `name` from mysql.proc where db = 'your_db_name' and `type` = 'procedure' //存储过程
select `name` from mysql.proc where db = 'your_db_name' and `type` = 'function' //函数
方法二:
show procedure status; //存储过程
show procedure status where db='servant_591up'
show function status; //函数
查看存储过程或函数的创建代码
show create procedure proc_name;
show create function func_name;
查看视图
select * from information_schema.views //视图
select * from information_schema.tables //表
查看触发器
方法一:
语法:show triggers [from db_name] [like expr]
实例:show triggers\g //触发器
方法二:
对information_schema数据库中的triggers表查询
mysql>select * from triggers t where trigger_name=”mytrigger” \g