Unqualified function, procedure, specific name, type, and variables

The qualification of function, procedure, specific name, type (built-in types, distinct types, and array types), and variables, depends on the SQL statement in which the unqualified name appears.

  • If an unqualified name is the main object of an ALTER, CREATE, COMMENT, LABEL, DROP, GRANT, or REVOKE statement, the name is implicitly qualified using the same rules as for qualifying unqualified table names (See Unqualified alias, constraint, external program, index, mask, nodegroup, package, permission, sequence, table, trigger, view, and XSR object names).
  • Otherwise, the implicit schema name is determined as follows:
    • For type names, database manager searches the SQL path and selects the first schema in the path such that the data type exists in the schema.
    • For variable names, database manager searches the SQL path and selects the first schema in the path such that the schema contains an authorized variable with the same name
    • For procedure names, database manager searches the SQL path and selects the first schema in the path such that the schema contains an authorized procedure with the same name and number of parameters.
    • For function names, database manager uses the SQL path in conjunction with function resolution, as described under Function resolution.
    • For specific names specified for sourced functions, see CREATE FUNCTION (sourced).