.TOUPPER() or !.TOUPPER(), that's the question
-
Bumped into this beauty today that should convert uppercase to lowercase. Never mind the irony of the replace function itself.
[code]SET upper(substring(UserFirst_Name, 1,1)) + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(substring(lower(UserFirst_Name), 2,9000), ' a', ' A'), ' b', ' B'), ' c', ' C'), ' d', ' D'), ' e', ' E'), ' f', ' F'), ' g', ' G'), ' h', ' H'), ' i', ' I'), ' j', ' J'), ' k', ' K'), ' l', ' L'), ' m', ' M'), ' n', ' N'), ' o', ' O'), ' p', ' P'), ' q', ' Q'), ' r', ' R'), ' s', ' S'), ' t', ' T'), ' u', ' U'), ' v', ' V'), ' w', ' W'), ' x', ' X'), ' y', ' Y'), ' z', ' Z') end[/code]
-
UserFirst_Name
WTF is that naming convention? I would understand
User_FirstName
or something like that... but like this? Does it make sense in the codebase?Unless it is the name of the first user, I guess?
Filed Under: Completely ignoring the replace stupidity
-
There's a field 'UserFrist_Name' for that.
-
Oh my....
@jaloopa, I may need to borrow your old avatar...
-
Two versions in the hatting thread
-
I like how it's tied to a specific variable and not a generic function anybody can use. Which means this monstrosity probably exists 47 different places in the codebase.
-
What the...
-
substring(lower(UserFirst_Name), 2,9000)
I see that it goes up to NINE THOUSAAAAAAAND!!!!!!
-
I see that it goes up to NINE THOUSAAAAAAAND!!!!!!
I forget if I mentioned this before--but in Windows 10, the command prompt window scrollback size was bumped up to 9001 from 300 or whatever.