PDA

View Full Version : lower to upper case query


md778
05-05-2003, 02:09 AM
Hi all, I urgently need help on following issue:
I have some database entries from the same user,
but with differences in the first letter (sometimes it´s upper,
sometimes lower case), which reflects on some tasks the user should be able to perform...I´m trying to build a query that searches the whole database, finds the entries where the user has a lower case and updates it to upper case.I would appreciate any help,
thanks a lot in advance.

raf
05-05-2003, 07:40 PM
Hmm. Not easy.
For starters, they need to be blobs (text and varchar aren't casesensitive).
If it was just fro one letter, you could probably use a REGEX. and have it over in one sql statement. So you could have a loop that creates 26 sql update-statements + executes them. Not sure though. Never used something like that.

Or you could run one sql statement to select all the records where that field starts with a lowercase and then use PHP to change the first character and then update all these records.

But i would advice to create an addition variable where you store some value, instead of all that stuff with upper and lower cases. (never heard of that + can't imagen that this is the best way to go)