Name

SET PATH Statement

The SET PATH statement changes the value of the CURRENT PATH setting to one or more schemas.

Platform

Command

MySQL

Not supported

Oracle

Not supported

PostgreSQL

Not supported

SQL Server

Not supported

SQL2003 Syntax

SET PATH schema_name[, ...]

Keywords

schema_name[, . . . ]

Defines one or more schemas as the current path.

Rules at a Glance

SET PATH defines one or more schemas used to qualify an unqualified routine name (that is, functions, procedures, and methods).

The following example sets the current path (i.e., schema name) for unqualified objects to scott:

SET PATH scott;

Then, whenever a routine is referenced during the current session, it will assume the scott schema if no schema is identified.

Programming Tips and Gotchas

When referencing multiple schema names, all the schemas must belong to the current database. (The schemas cannot be on a remote database.)

SET PATH does not apply the schema to unqualified objects like tables or views; it only applies to routines.

SET PATH is not supported on any of the platforms discussed in this book.

See Also

SET SCHEMA

Get SQL in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.