首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在Mysql中按注释选择存储过程名称

在Mysql中按注释选择存储过程名称
EN

Stack Overflow用户
提问于 2018-05-02 19:01:21
回答 2查看 443关注 0票数 1

如何在Mysql中通过注释获取存储过程名称?

例如,我需要这样的东西:

    SELECT *
    FROM stored_procedures
    WHERE comment LIKE '%something%''
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-05-02 19:08:13

您可以使用以下代码从information_schema获取存储过程名称:

SELECT routine_schema,      -- database/schema wherein the object resides
       routine_name,        -- the name of the function/procedure
       routine_type,        -- PROCEDURE indicates a procedure, FUNCTION indicates a function
       routine_definition   -- code underlying the sp
       routine_comment      -- some human readable comment on the routine
  FROM information_schema.routines
  WHERE routine_comment LIKE '%test%';
票数 3
EN

Stack Overflow用户

发布于 2018-05-02 19:10:25

是的,你可以像这样的评论来搜索proc。

SELECT mysql.proc.name
FROM mysql.proc
WHERE mysql.proc.comment LIKE '%abc%';
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50133058

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档