当前位置:Gxlcms > mysql > mysql生成完整的存储过程定义语句_MySQL

mysql生成完整的存储过程定义语句_MySQL

时间:2021-07-01 10:21:17 帮助过:30人阅读

 

SELECT   CONCAT('PR_', p.db,'.',p.name ) FileName ,
CONCAT(
'
DELIMI','TER $$

USE `',p.db,'`$$

DROP PROCEDURE IF EXISTS `',p.name, '`$$

CREATE DEFINER=','`',
LEFT(DEFINER, -1+LOCATE('@',DEFINER)),
'`@`',
RIGHT(DEFINER,LENGTH(DEFINER)-LOCATE('@',DEFINER)),
'`'
,' PROCEDURE `',p.name ,'`(',p.param_list,')
',p.body_utf8,
'$$

DELIMI','TER ;
' ) AS sql_create 
FROM mysql.proc AS p 
WHERE p.db LIKE '%'
AND TYPE LIKE 'PROC%'
ORDER BY p.db,p.name ;

人气教程排行