Connected/Selected Datasource options
While you can connect to multiple datasources, at any one time only one connected datasource is the currently selected datasource. The currently selected datasource is displayed in the Datasource toolbar. For multiple-database datasources such as SQL Server and Sybase, a currently selected database is also displayed.
Certain features, to varying degrees, depend on the currently selected datasource or selected datasource/database combination. On a fairly trivial level, availability of some features or the initial state of a feature on being invoked is dependent on the selected datasource:
- In DBArtisan, Utilities menu feature availability (backup, restore, import, export, for example) depends on the DBMS platform of the selected datasource.
- Some features, Query Builder for example, have user interface controls for selecting a datasource. On opening, these user interface items default to the currently selected datasource.
More strongly dependent on the selected datasource is the SQL Editor. A SQL Editor window not locked to a datasource, will direct all transactions to the currently selected datasource.
- Note: For information on how to lock and unlock a SQL Editor window, see Locking a SQL Editor Window to a Datasource
When the Datasource Navigator/Explorer is active, a SQL Editor opened against a particular datasource will continue to direct transactions to that datasource, until you explicitly change the selected datasource. Whether a SQL Editor or any other window or other user interface element is active, the method of explicitly changing the selected datasource is the same.
To Explicitly Make a Datasource the Selected Datasource
- Select the datasource from the Select Datasource dropdown on the Datasource toolbar. Optionally, on a multi-database DBMS platform, select a database using the Select From Available Databases dropdown.
With a Datasource Navigator/Explorer active, while an unlocked SQL Editor window is open, the selected datasource can be changed explicitly or automatically in response to Navigator/Explorer navigation or related user interface actions.
This can result in the following issues:
- Active session-specific features such as execution directives and query options being sent to the wrong datasource
- Features such as Semantic Validation returning false errors
How the selected datasource changes depends on the state of the Link button appearing at the top of the Navigator/Explorer pane:
|Link Button State||Description|
You can explicitly change the active datasource by selecting a datasource from the Select Datasource dropdown. The active datasource changes automatically as datasource-associated windows such as object editors become active in the Workspace or as you select nodes in the Navigator/Explorer. As a side effect, the associated datasource node in the Navigator/Explorer tree is selected.
When linking is inactive, you can only explicitly change the active datasource when an SQL Editor window is open. The active datasource still changes automatically as datasource-associated windows such as object editors become active in the Workspace. And when linking is inactive, the change in the selected datasource has no effect on the selected node in the Navigator/Explorer tree.
To toggle between the two link states
- Click the Link button.