salix/db/routines/util/procedures/exec.sql

19 lines
355 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`exec`(vSqlQuery TEXT)
SQL SECURITY INVOKER
BEGIN
/**
* Executes a string with an SQL query.
*
* @param vSqlQuery The SQL string
*/
SET @sqlQuery = vSqlQuery;
PREPARE stmt FROM @sqlQuery;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sqlQuery = NULL;
END$$
DELIMITER ;