A schema is a collection of named objects. The objects that a schema can contain include distinct types, functions, stored procedures, and triggers. An object is assigned to a schema when it is created. The schema name of the object determines the schema to which the object belongs.
When a distinct type, function, or trigger is created, it is given a qualified, two-part name. The first part is the schema name (or the qualifier), which is either implicitly or explicitly specified. The second part is the name of the object.
When a stored procedure is created, it is given a three-part name. The first part is a location name, which is implicitly or explicitly specified, the second part is the schema name, which is implicitly or explicitly specified, and the third part is the name of the object.
Schemas extend the concept of qualifiers for tables, views, indexes, and aliases to enable the qualifiers for distinct types, functions, stored procedures, and triggers to be called schema names.
The SQL path is an ordered list of schema names. DB2 uses the path to resolve the schema name for unqualified data type (both built-in and distinct type), function, and stored procedure names that appear in any context other than as the main object of an ALTER, CREATE, DROP, COMMENT ON, GRANT or REVOKE task.
Searching through the SQL path from left to right, DB2 implicitly qualifies the object name with the first schema name in the path that contains the same object with the same unqualified name for which the user has appropriate authorization.
For procedures, DB2 selects a matching procedure name only if the number of parameters is also the same.
For functions, DB2 uses a process called function resolution in conjunction with the SQL path to determine which function to choose because several functions with the same name can reside in a schema.