How TRIM_ORACLE() Works in MariaDB

In MariaDB, TRIM_ORACLE() is a synonym for the Oracle mode version of the TRIM() function.

TRIM_ORACLE() is available in all modes, so it saves you from having to switch to Oracle mode, which is what you’d need to do if you wanted the TRIM() function to behave like Oracle’s TRIM() function.

The difference is in how each function treats empty strings. Oracle returns null whereas MariaDB returns an empty string.

Continue reading

How LTRIM_ORACLE() Works in MariaDB

In MariaDB, LTRIM_ORACLE() is a synonym for the Oracle mode version of the LTRIM() function.

LTRIM_ORACLE() is available in all modes, so it saves you from having to switch to Oracle mode, which is what you’d need to do if you wanted the LTRIM() function to behave like Oracle’s LTRIM() function.

The difference is in how each function treats empty strings. Oracle returns null whereas MariaDB returns an empty string.

Continue reading

How RTRIM_ORACLE() Works in MariaDB

In MariaDB, RTRIM_ORACLE() is a synonym for the Oracle mode version of the RTRIM() function.

RTRIM_ORACLE() is available in all modes, so it saves you from having to switch to Oracle mode, which is what you’d need to do if you wanted the RTRIM() function to behave like Oracle’s RTRIM() function.

The difference is in how each function treats empty strings. Oracle returns null whereas MariaDB returns an empty string.

Continue reading

How EXTRACTVALUE() Works in MariaDB

In MariaDB, EXTRACTVALUE() is a built-in string function that returns CDATA from an XML fragment.

The way it works is that it accepts two string arguments: a fragment of XML markup and an XPath expression (i.e. a locator). EXTRACTVALUE() then returns the CDATA (i.e. the text) of the first text node which is a child of the element or elements matching the XPath expression.

Continue reading