Ownership of objects with unqualified names
If an object name is unqualified, the object type and the way it is created determine its ownership.
If the name of a table, view, index, alias, or synonym
is unqualified, you can establish the object's ownership in the following
ways:
- If you issue the CREATE statement dynamically, perhaps using SPUFI, QMF, or some similar program, the owner of the created object is your current SQL ID. That ID must have the privileges that are needed to create the object.
- If you issue the CREATE statement statically, by
running a plan or package that contains it, the ownership of the created
object depends on the option that is used for the bind operation.
You can bind the plan or package with either the QUALIFIER option,
the OWNER option, or both.
- If the plan or package is bound with the QUALIFIER option only, the authorization ID in the QUALIFIER option is the owner of the object. The QUALIFIER option allows the binder to name a qualifier to use for all unqualified names of tables, views, indexes, aliases, or synonyms that appear in the plan or package.
- If the plan or package is bound with the OWNER option only, the authorization ID in the OWNER option is the owner of the object.
- If the plan or package is bound with both the QUALIFIER option and the OWNER option, the authorization ID in the QUALIFIER option is the owner of the object.
- If neither option is specified, the authorization ID of the binder of the plan or package is implicitly the object owner.
If the name of a user-defined function, stored procedure, distinct type, sequence, or trigger is unqualified, you can establish the ownership of one of these objects in these ways:
- If you issue the CREATE statement dynamically, the owner of the created object is your current SQL ID. That ID must have the privileges that are needed to create the object.
- If you issue the CREATE statement statically, by running a plan or package that contains it, the owner of the object is the plan or package owner. You can use the OWNER bind option to explicitly name the object owner. If you do not use the OWNER bind option, the binder of the package or plan is implicitly the object owner.
If the name of a user-defined function, stored procedure,
distinct type, sequence, or trigger is unqualified,
the implicit qualifier is determined based on the schema name in dynamic
statements and the PATH bind option in static statements. The owner
of a JAR (Java™ class for a routine)
that is used by a stored procedure or a user-defined function is the
current SQL ID of the process that performs the INSTALL_JAR function.