Connected/Selected Datasource options

From RapidSQL
Jump to: navigation, search

Go Up to Using the Datasource Navigator

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.

am167e08.jpg

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.
  • In Rapid SQL, Browse menu object type availability is dependent on DBMS platform of the currently 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 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

  1. 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 active, while an unlocked SQL Editor window is open, the selected datasource can be changed explicitly or automatically in response to Navigator 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 pane:

Link Button State Description

am167e26.jpg The Navigator is linked to the Select Datasource combo

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. As a side effect, the associated datasource node in the Navigator tree is selected.

am167e2f.jpg The Navigator is NOT linked to the Select Datasource combo

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 tree.

To toggle between the two link states

  1. Click the Link button.