0

Got a database that somebody messed up, and I've been asked to try to fix it. But I've been searching, and it doesn't look like MariaDB does this natively.

I've seen scripts for Postgres and even plain SQL, but neither of them work on MariaDB.

Was wondering if anybody out there has a function or maybe some tip or trick to capitalize the first letter of each word in a column of entries. Keep in mind that many of these entries contain contractions, like can't, which I don't want ending up like Can'T. Same goes for hyphens, and parentheses. Also, the database is UTF-8, so lots of foreign languages as well.

Any help or direction would be much appreciated, as I'm just not even sure where to start, and google has even failed me for once...

darkflux
  • 93
  • 1
  • 1
  • 8
  • I realize that you asked natively, but If you can use PHP, there is function called [ucwords](https://www.php.net/manual/en/function.ucwords.php) that can be applied to the fetched data and then update back to the DB afterwards. – Paul T. Jul 08 '20 at 01:25
  • 1
    So apparently I cannot even answer my own question. Why even have the option there? But I found the solution here: https://stackoverflow.com/a/25298869/2593328 It wasn't the chosen answer for the post so I missed it. But it does exactly what I needed. – darkflux Jul 08 '20 at 21:56

0 Answers0