Unqualified alias, constraint, external program, index, mask, nodegroup, package, permission, sequence, table, trigger, view, and XSR object names

Start of changeUnqualified alias, constraint, external program, index, mask, nodegroup, package, permission, sequence, table, trigger, view, and XSR object names are implicitly qualified by the default schema.End of change

The default schema is specified as follows:

  • For static SQL statements:
    • If the DFTRDBCOL parameter is specified on the CRTSQLxxx command (or with the SET OPTION statement), the default schema is the schema-name that is specified for that parameter.
    • In all other cases, the default schema is based on the naming convention.
      • For SQL naming, the default schema is the authorization identifier of the statement.
      • For system naming, the default schema is the job library list (*LIBL).
  • For dynamic SQL statements the default schema depends on whether a default schema has been explicitly specified. The mechanism for explicitly specifying this depends on the interface used to dynamically prepare and execute SQL statements.
    • If a default schema is not explicitly specified:
      • For SQL naming, the default schema is the run-time authorization identifier.
      • For system naming, the default schema is the job library list (*LIBL).
    • The default schema is explicitly specified through the following interfaces:
      Table 1. Default Schema Interfaces
      SQL Interface Specification
      Embedded SQL DFTRDBCOL parameter and DYNDFTCOL(*YES) on the Create SQL Program (CRTSQLxxx) and Create SQL Package (CRTSQLPKG) commands. The SET OPTION statement can also be used to set the DFTRDBCOL and DYNDFTCOL values. (For more information about CRTSQLxxx commands, see Embedded SQL Programming.)
      Run SQL Statements DFTRDBCOL parameter on the Run SQL Statements (RUNSQLSTM) command. (For more information about the RUNSQLSTM command, see SQL Programming.)
      Call Level Interface (CLI) on the server SQL_ATTR_DEFAULT_LIB or SQL_ATTR_DBC_DEFAULT_LIB environment or connection variables (For more information about CLI, see SQL Call Level Interfaces (ODBC).)
      JDBC or SQLJ on the server using IBM® IBM Developer Kit for Java™ libraries property object (For more information about JDBC and SQLJ, see IBM Developer Kit for Java.)
      ODBC on a client using the IBM i Access Family ODBC Driver SQL Default Schema in ODBC Setup (For more information about ODBC, see IBM i Access.)
      JDBC on a client using the IBM Toolbox for Java SQL Default Schema in JDBC Setup (For more information about JDBC, see IBM i Access.) (For more information about the IBM Toolbox for Java, see IBM Toolbox for Java.)
      OLE DB on a client using the IBM i Access Family OLE DB Provider DefaultCollection in Connection Object Properties (For more information about OLE DB, see IBM i Access.)
      ADO .NET on a client using the IBM i Access Family ADO .NET Provider DefaultCollection in Connection Object Properties (For more information about ADO .NET, see IBM i Access.)
      All interfaces SET SCHEMA or QSQCHGDC (Change Dynamic Default Collection) API (For more information about QSQCHGDC, see the File APIs category.)