Skip to content

Declaring which connection

tremechus edited this page Feb 8, 2015 · 1 revision

Sometimes it is useful to specify which connection a statement should use regardless of the current active connection.

This can be done with the 'using' directive:

using mydb select * from Chinook

This will look in the connection list for a connection named 'mydb' and always use that connection for this statement.

The connection name is case insensitive. If there are duplicate connection names it will select the first one in the list.

If your connection name has whitespace in it you can quote the name with either single or double quotes:

using "my db" select * from Chinook

or

using 'my db' select * from Chinook

Clone this wiki locally