The SCHEMA() function returns the current database name as a string.
Within stored routines, the default database is the database associated with the routine.
A database can be selected with the USE statement.
If no default database is defined, the SCHEMA() function returns NULL. |