开发者

Get Stored Proc Schema name in mysql

I would like to get the schema name string of a stored proc inside the stored proc itself. I开发者_高级运维 don't know if it's possible because I didn't find any information about it.

Exemple :

DELIMITER $$

DROP PROCEDURE IF EXISTS `exemple` $$
CREATE DEFINER=`root`@`%` PROCEDURE `exemple`()
BEGIN
  DECLARE schema_name VARCHAR(100) DEFAULT NULL;
  SELECT GET_STORED_PROC_SCHEMA_NAME FROM STORED_PROC_INFO INTO schema_name;  
END $$

DELIMITER ;

Thank you


It's easy to do that, use the DATABASE() function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜