Unqualified alias, index, JAR file, sequence, table, trigger, and view names

Unqualified alias, index, JAR file, sequence, table, trigger, and view names are implicitly qualified by the default schema.

The default schema is determined as follows:

  • For static SQL statements, the default schema is the identifier specified in the QUALIFIER option of the BIND subcommand or the CREATE or ALTER statement for a SQL routine. If this option is not in effect for the plan, package, or native SQL procedure, the default schema is the authorization ID of the owner of the plan, package, or native SQL procedure.
  • For dynamic SQL statements, the behavior as specified by the combination of the DYNAMICRULES option and the run time environment determines the default schema. (For a list of these behaviors and the DYNAMICRULES values that determine them, see Table 1).
    • If DYNAMICRULES run behavior applies, the default schema is the schema in the CURRENT SCHEMA special register. Run behavior is the default.
    • If bind behavior applies, the default schema is the identifier that is implicitly or explicitly specified in the QUALIFIER option, as explained for static SQL statements.
    • If define behavior applies, the default schema is the owner of the function or stored procedure (the owner is the definer).
    • If invoke behavior applies, the default schema is the authorization ID of the invoker of the function or stored procedure.
    Exception: For bind, define, and invoke behavior, the default schema of PLAN_TABLE, DSN_STATEMNT_TABLE, and DSN_FUNCTION_TABLE (output from the EXPLAIN statement) is always the value in special register CURRENT SQLID.