欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

MYSQL分享:获取存取过程完整定义语句_MySQL

程序员文章站 2022-05-17 10:21:26
...
bitsCN.com

MYSQL分享:获取存取过程完整定义语句

[sql]

SELECT db,specific_name AS OBJECT_NAME ,

CONCAT(

CHAR(13),

CHAR(10),

'DELIMITER $$',

CHAR(13),

CHAR(10),

CHAR(13),

CHAR(10),

'USE `',

db,

'`$$',

CHAR(13),

CHAR(10),

CHAR(13),

CHAR(10),

'DROP PROCEDURE IF EXISTS `',

specific_name,

'`$$',

CHAR(13),

CHAR(10),

CHAR(13),

CHAR(10),

'CREATE ',

security_type,

'=`',

REPLACE(`definer`, '@', '`@`'),

'` PROCEDURE `',

specific_name,

'` (',

param_list,

')',

CHAR(13),

CHAR(10),

body,

'$$',

CHAR(13),

CHAR(10),

CHAR(13),

CHAR(10),

'DELIMITER ;',

CHAR(13),

CHAR(10),

CHAR(13),

CHAR(10)

) AS DEFINITION

FROM

mysql.proc a

WHERE `type` = 'PROCEDURE'

bitsCN.com