In Oracle, the USERENV function returns information about the current session.
In MariaDB, session information must be retrieved using dedicated functions for each specific attribute.
Oracle:
-- Get the current session ID SELECT USERENV('SESSIONID') FROM dual; /* 797676 */
MariaDB:
-- Get the current session ID SELECT CONNECTION_ID(); /* 14 */
Mapping USERENV parameters:
| Oracle | MariaDB | |||
| 1 | USERENV('SESSIONID') | Get the session ID | CONNECTION_ID() | ID values are different |
For more information, see Oracle to MariaDB Migration.