Get name of stored proxy schema in mysql

I would like to get the schema name string of a stored procedure inside a stored process. I don't know if this is possible because I haven't found any information about it.

Example:

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 ;

      

thanks

+2


a source to share


1 answer


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



+3


a source







All Articles