TRANSLATE() Function in Oracle

In Oracle, the TRANSLATE() function allows you to make several single-character, one-to-one substitutions in one operation.

It returns the string provided as a first argument after some characters specified in the second argument are translated into a destination set of characters specified in the third argument.

It’s similar to the REPLACE() function, except that the REPLACE() function replaces the whole string with another string (i.e. not character by character, like TRANSLATE() does).

Continue reading

MariaDB LENGTH() vs LENGTHB(): What’s the Difference?

Ever since version 10.3.1, MariaDB has included both a LENGTH() function and a LENGTHB() function.

That second one has a B at the end of the name. So it’s kind of like Length A and Length B, except that Length A doesn’t have the A.

Confused?

I was, when I first encountered LENGTHB(). I already knew about LENGTH(), so why the need for a “B” version?

Let’s find out.

Continue reading