19 lines
355 B
MySQL
19 lines
355 B
MySQL
|
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 ;
|