Hello!
You'll have to use a DB function. For example:
DELIMITER //
CREATE FUNCTION UC_WORDS(oldName VARCHAR(255), delim VARCHAR(1)) RETURNS VARCHAR(255)
BEGIN
SET @oldString := oldName;
SET @newString := "";
tokenLoop: LOOP
SET @splitPoint := LOCATE(delim, @oldString);
IF @splitPoint = 0 THEN
SET @newString := CONCAT(@newString, UC_FIRST(@oldString));
LEAVE tokenLoop;
END IF;
SET @newString := CONCAT(@newString, UC_FIRST(SUBSTRING(@oldString, 1, @splitPoint)));
SET @oldString := SUBSTRING(@oldString, @splitPoint+1);
END LOOP tokenLoop;
RETURN @newString;
END//
DELIMITER ;
After creating the function, you can use an SQL like this:
SELECT UC_WORDS('testing-this-thing', '-', TRUE);
Result will be "Testing-This-Thing".
Another example with blank spaces:
SELECT UC_WORDS('this is another test', ' ', TRUE);
Result will be "This Is Another Test".
Hope that helps.
Alex.