Function Name Case Insensitive

Q

Are MySQL function names case sensitive?

✍: FYIcenter.com

A

No. MySQL function names are not case sensitive. You can write function names in upper case or lower case. For example:

SELECT PI(), pi(), Pi();
  -- +----------+----------+----------+
  -- | PI()     | pi()     | Pi()     |
  -- +----------+----------+----------+
  -- | 3.141593 | 3.141593 | 3.141593 |
  -- +----------+----------+----------+

Function argument modifiers are also not case sensitive. For example:

SET @str = 'Yahooo';

SELECT TRIM(BOTH 'o' FROM @str), trim(both 'o' from @str);
  -- +--------------------------+--------------------------+
  -- | TRIM(BOTH 'o' FROM @str) | trim(both 'o' from @str) |
  -- +--------------------------+--------------------------+
  -- | Yah                      | Yah                      |
  -- +--------------------------+--------------------------+

 

Function Argument Modifier

Calling MySQL Built-in Functions

Calling MySQL Built-in Functions

⇑⇑ MySQL Function References

2023-11-15, 253🔥, 0💬