> does it work outside the function?
Yes, If I run:
select CONCAT(UPPER(SUBSTRING('JESSE',1,1)),LOWER(SUBSTRING('JESSE',2)));
replacing cInput with 'JESSE', it returns "Jesse" as it should.
> did you tried SUBSTRING(cInput, 2)?
Tried replacing SUBSTRING(cInput FROM 2) with SUBSTRING(cInput, 2) and it
didn't make any difference.
> did you tried with converting?
I have had issues with this in other areas before, but didn't think about it
this time. However, I tred CONVERT with UTF8 and latin1 as you suggested.
> "LOWER() (and UPPER()) are ineffective when applied to binary strings
> (BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert the
> string to a non-binary string:
>
> mysql> SET @str = BINARY 'New York';
> mysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));"
I converted the function over to use a variable, and got the same results.
Here's the new function:
CREATE FUNCTION `ProperCase`(cInput TEXT)
RETURNS text
DETERMINISTIC
CONTAINS SQL
SQL SECURITY INVOKER
COMMENT ''
BEGIN
Declare str Text;
Declare cReturn Text;
Set @str=BINARY cInput;
Set @cReturn =
CONCAT(UPPER(SUBSTRING(@str,1,1)),LOWER(SUBSTRING(@str,2)));
RETURN @cReturn;
END;
Still doesn't work. This is driving me NUTz 8-p
Jesse