Setting the schema to use for unqualified objects, the SQL ID, or both

When an SQL statement references unqualified objects, those objects are qualified by a default schema. There are several locations in which you can specify the default schema to use. Also, if a statement runs on DB2 for z/OS, you can specify an SQL ID to use in several locations.

Setting the schema for unqualified objects in SQL statements that run on DB2 for Linux, UNIX, and Windows

There are two locations in which you can specify a schema to use for unqualified objects in SQL statements that run on DB2 for Linux, UNIX, and Windows. Here are those locations in order of precedence.

The Run Single-Query Advisors and Tools page of the Invoke section
Specify the schema in the Schema field, which is directly below the Database connection field.
When you specify the schema in this location, the global preference is ignored.
The global preferences
Remember: Close open instances of the workflow assistant before setting this preference.
To set the default schema in the global preferences:
  1. In the main menu, select Window > Preferences.
  2. In the Preferences window, expand Data Management > Visual Explain.
  3. On the EXPLAIN Options page, click the tab labeled DB2 for Linux, UNIX, and Windows.
  4. Type or select a value in the CURRENT SCHEMA field.
  5. Click Apply, then click OK.

Setting the schema to use for unqualified objects in SQL statements that run on DB2 for z/OS and setting the SQL ID

There are three locations in which you can set these values. Here they are in order of precedence.

The Run Single-Query Advisors and Tools page of the Invoke section
Specify the values in the Schema and SQL ID fields, which are directly below the Database connection field.
When you specify the values in this location, the settings in the other locations are ignored.
The Data Source Explorer
In the current connection, right-click the subsystem and select Analyze and Tune > Change Default SQL ID and Schema.
When you specify the values in this location, the settings in the global preferences are ignored. However, the values in this location are ignored if you specify the values before running the advisors.
The global preferences
Remember: Close open instances of the workflow assistant before setting this preference.
To set these values in the global preferences:
  1. In the main menu, select Window > Preferences.
  2. In the Preferences window, expand Data Management > Query Tuner.
  3. On the EXPLAIN Options page, click the tab labeled DB2 for z/OS.
  4. Specify the default schema and SQL ID for individual connections.
  5. Click Apply, then click OK.

Feedback