We are trying to create a couple of functions in Monet. Every function we create has a terrible bad performance.
CREATE FUNCTION sb_glob.camelcase(input VARCHAR(500))
RETURNS VARCHAR(500)
begin
DECLARE len INT;
DECLARE i INT;
SET len = CHAR_LENGTH(input);
SET input = LOWER(input);
SET i = 0;
WHILE (i < len) DO
SET input = CASE WHEN ((SUBSTR(input,i,1) = ' ' OR SUBSTR(input,i,1) = '-' OR i = 0) AND (i < len)) THEN (LEFT(input,i) || UPPER(SUBSTR(input,i + 1,1)) || RIGHT(input,len - i - 1))
ELSE input END;
SET i = i + 1;
END WHILE;
RETURN input;
END