Syntax\n------\n\nSET PATH 'db1 [, db2 [, ...]]'\n\nDescription\n-----------\n\nSets the list of schemas (databases) that MariaDB uses to search for stored routines to invoke. Such a search happens in the CALL statement and when stored function are used in expressions.\n\nThe value of the path is a string which contains comma-separated schema names. A schema name can be quoted with backticks (or double quotes, as appropriate). A special name CURRENT_SCHEMA means to look in the current schema. Spaces are ignored, unless they are part of a quoted schema name. A path cannot contain two equivalent schema names.\n\nThe following two commands invoke the same stored procedure:\n\n``sql\nCALL sys.optimizer_switch_on();\n`\nand\n`sql\nSET PATH 'sys';\nCALL optimizer_switch_on();\n`\n\nA default value of the path is 'CURRENT_SCHEMA' which provides the traditional behavior — stored routines must be in the current database.\n\nAlso the path is used to look up packages in package routine invocations. Assuming there is a package UTL_ENCODE in the sys schema, and it contains the function BASE64_DECODE(), one can write\n\n`sql\nSELECT sys.UTL_ENCODE.BASE64_DECODE('data');\n`\nor\n`sql\nSET PATH='sys'; \nSELECT UTL_ENCODE.BASE64_DECODE('data');\n`\n\nNotes\n\n This functionality introduces the @@path system variable (session and global).\n The SET PATH statement sets the @@session.path variable. It is also possible to assign a new value to the @@path variable directory, using a statement like this: SET @@path='sys'`.\n* Prepared statements, stored routines, and views remember the value of the path when they are created. The value of the path at the time of the execution does not apply.\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/set-commands/set-path