CREATE DEFINER=`test`@`localhost` PROCEDURE `tests`()
BEGIN
drop function if exists HelloWorld;
CREATE FUNCTION HelloWorld() RETURNS VARCHAR(20)
DETERMINISTIC
BEGIN
DECLARE result varchar(30);
SET result = 'HELLO WORLD';
RETURN (result);
END
select HelloWorld();
END
SET @columnName = 'column';
SET @sql = CONCAT("SELECT '", @columnName, "' FROM `table`");
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;