开发者

Get Stored Proc Schema name in mysql

开发者 https://www.devze.com 2022-12-27 12:13 出处:网络
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.

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

精彩评论

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